| 
									
										
										
										
											2013-11-08 13:34:59 -05:00
										 |  |  | from .. import util | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | frozen_importlib, source_importlib = util.import_importlib('importlib') | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import builtins | 
					
						
							| 
									
										
										
										
											2009-02-01 04:28:04 +00:00
										 |  |  | import functools | 
					
						
							| 
									
										
										
										
											2009-08-27 23:44:18 +00:00
										 |  |  | import importlib | 
					
						
							|  |  |  | import unittest | 
					
						
							| 
									
										
										
										
											2009-02-01 04:28:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-08 13:34:59 -05:00
										 |  |  | __import__ = staticmethod(builtins.__import__), staticmethod(source_importlib.__import__) | 
					
						
							| 
									
										
										
										
											2009-02-01 04:28:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def mock_path_hook(*entries, importer): | 
					
						
							|  |  |  |     """A mock sys.path_hooks entry.""" | 
					
						
							|  |  |  |     def hook(entry): | 
					
						
							|  |  |  |         if entry not in entries: | 
					
						
							|  |  |  |             raise ImportError | 
					
						
							|  |  |  |         return importer | 
					
						
							|  |  |  |     return hook |