[pypy-svn] r13180 - pypy/dist/pypy/translator/llvm

ericvrp at codespeak.net ericvrp at codespeak.net
Wed Jun 8 15:36:38 CEST 2005


Author: ericvrp
Date: Wed Jun  8 15:36:38 2005
New Revision: 13180

Modified:
   pypy/dist/pypy/translator/llvm/compyle.py
Log:
commit before move


Modified: pypy/dist/pypy/translator/llvm/compyle.py
==============================================================================
--- pypy/dist/pypy/translator/llvm/compyle.py	(original)
+++ pypy/dist/pypy/translator/llvm/compyle.py	Wed Jun  8 15:36:38 2005
@@ -74,7 +74,16 @@
     modname = options.python_script.replace('/', '.')
     if modname[-3:] == '.py':
         modname = modname[:-3]
-    exec "import %(modname)s as testmodule" % locals()
+
+    if modname[0] == '.':   #absolute path
+        #print imp.find_module(options.python_script)
+        sys.path.append('/')  #XXX may not work on all platforms
+        #print sys.path
+        absmodname = modname[1:]
+        exec "import %(absmodname)s as testmodule" % locals()
+        ##print 'pop',sys.path.pop()
+    else:   #relative path
+        exec "import %(modname)s as testmodule" % locals()
 
     if '(' in options.entry_function:
         entry_function, arguments = options.entry_function.split('(',1)



More information about the Pypy-commit mailing list