[Python-checkins] r55953 - sandbox/trunk/import_in_py/pseudocode.py

brett.cannon python-checkins at python.org
Wed Jun 13 06:56:10 CEST 2007


Author: brett.cannon
Date: Wed Jun 13 06:56:08 2007
New Revision: 55953

Modified:
   sandbox/trunk/import_in_py/pseudocode.py
Log:
Add stub for loader of Python source and bytecode.


Modified: sandbox/trunk/import_in_py/pseudocode.py
==============================================================================
--- sandbox/trunk/import_in_py/pseudocode.py	(original)
+++ sandbox/trunk/import_in_py/pseudocode.py	Wed Jun 13 06:56:08 2007
@@ -1,7 +1,6 @@
 raise ImportError("module is just pseudocode")
 
 import sys
-
 def __import__(name, globals, locals, fromlist, level):
     """Pseudocode to explain how importing works.
 
@@ -159,8 +158,12 @@
         pkg_init_path = os.path.join(path_entry, immediate_name,
                                         '__init__' + suffix)
         if os.path.isfile(pkg_init_path):  # I/O
-            return package_loader(name, pkg_init_path)
+            return py_loader(name, pkg_init_path, is_pkg=True)
         # If module is not a package, see if it is a file by itself.
         file_path = os.path.join(path_entry, immediate_name + suffix)
         if os.path.isfile(file_path):  # I/O
-            return py_loader(name, file_path)
+            return py_loader(name, file_path, is_pkg=False)
+
+
+def py_loader(name, file_path, is_pkg):
+    pass


More information about the Python-checkins mailing list