[pypy-svn] r39689 - pypy/dist/pypy/module/sys

hpk at codespeak.net hpk at codespeak.net
Fri Mar 2 15:42:56 CET 2007


Author: hpk
Date: Fri Mar  2 15:42:53 2007
New Revision: 39689

Modified:
   pypy/dist/pypy/module/sys/state.py
   pypy/dist/pypy/module/sys/version.py
Log:
resolving the use of autopath here (translate seems to work, but
i'll check if it fully works still)


Modified: pypy/dist/pypy/module/sys/state.py
==============================================================================
--- pypy/dist/pypy/module/sys/state.py	(original)
+++ pypy/dist/pypy/module/sys/state.py	Fri Mar  2 15:42:53 2007
@@ -22,8 +22,8 @@
 
     def setinitialpath(self, space): 
         # Initialize the default path
-        from pypy.interpreter import autopath
-        srcdir = os.path.dirname(autopath.pypydir)
+        pypydir = os.path.dirname(os.path.abspath(pypy.__file__))
+        srcdir = os.path.dirname(pypydir)
         path = getinitialpath(srcdir)
         self.w_path = space.newlist([space.wrap(p) for p in path])
 

Modified: pypy/dist/pypy/module/sys/version.py
==============================================================================
--- pypy/dist/pypy/module/sys/version.py	(original)
+++ pypy/dist/pypy/module/sys/version.py	Fri Mar  2 15:42:53 2007
@@ -2,7 +2,6 @@
 Version numbers exposed by PyPy through the 'sys' module.
 """
 import os
-from pypy.interpreter import autopath
 
 
 CPYTHON_VERSION            = (2, 4, 1, "alpha", 42)
@@ -16,6 +15,10 @@
 REV = "$LastChangedRevision$"[22:-2]
 
 
+import pypy
+pypydir = os.path.dirname(os.path.abspath(pypy.__file__))
+del pypy
+
 # ____________________________________________________________
 
 def get_api_version(space):
@@ -66,11 +69,11 @@
     # to depend on an external 'svn' executable in the path.
     rev = int(REV)
     try:
-        f = open(os.path.join(autopath.pypydir, '.svn', 'format'), 'r')
+        f = open(os.path.join(pypydir, '.svn', 'format'), 'r')
         format = int(f.readline().strip())
         f.close()
         if format <= 6: # Old XML-format
-            f = open(os.path.join(autopath.pypydir, '.svn', 'entries'), 'r')
+            f = open(os.path.join(pypydir, '.svn', 'entries'), 'r')
             for line in f:
                 line = line.strip()
                 if line.startswith('committed-rev="') and line.endswith('"'):
@@ -78,7 +81,7 @@
                     break
             f.close()
         else: # New format
-            f = open(os.path.join(autopath.pypydir, '.svn', 'entries'), 'r')
+            f = open(os.path.join(pypydir, '.svn', 'entries'), 'r')
             format = int(f.readline().strip())
             for entry in f.read().split('\f'):
                 lines = entry.split('\n')



More information about the Pypy-commit mailing list