Author: Alexander Hesse <[email protected]>
Branch: split-rpython
Changeset: r59704:e92b34ba5faa
Date: 2013-01-02 18:12 +0100
http://bitbucket.org/pypy/pypy/changeset/e92b34ba5faa/
Log: Breaks more than it fixes
diff --git a/rpython/annotator/test/autopath.py
b/rpython/annotator/test/autopath.py
--- a/rpython/annotator/test/autopath.py
+++ b/rpython/annotator/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/backend/autopath.py b/rpython/jit/backend/autopath.py
--- a/rpython/jit/backend/autopath.py
+++ b/rpython/jit/backend/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/backend/x86/autopath.py
b/rpython/jit/backend/x86/autopath.py
--- a/rpython/jit/backend/x86/autopath.py
+++ b/rpython/jit/backend/x86/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/backend/x86/tool/autopath.py
b/rpython/jit/backend/x86/tool/autopath.py
--- a/rpython/jit/backend/x86/tool/autopath.py
+++ b/rpython/jit/backend/x86/tool/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/tl/autopath.py b/rpython/jit/tl/autopath.py
--- a/rpython/jit/tl/autopath.py
+++ b/rpython/jit/tl/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/tl/spli/autopath.py b/rpython/jit/tl/spli/autopath.py
--- a/rpython/jit/tl/spli/autopath.py
+++ b/rpython/jit/tl/spli/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/jit/tool/autopath.py b/rpython/jit/tool/autopath.py
--- a/rpython/jit/tool/autopath.py
+++ b/rpython/jit/tool/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/rlib/_rffi_stacklet.py b/rpython/rlib/_rffi_stacklet.py
--- a/rpython/rlib/_rffi_stacklet.py
+++ b/rpython/rlib/_rffi_stacklet.py
@@ -1,5 +1,5 @@
import py
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.rtyper.lltypesystem import lltype, llmemory, rffi
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.rtyper.tool import rffi_platform
@@ -7,7 +7,7 @@
import sys
-cdir = py.path.local(rpythondir) / 'translator' / 'c'
+cdir = py.path.local(pypydir) / 'translator' / 'c'
eci = ExternalCompilationInfo(
include_dirs = [cdir],
diff --git a/rpython/rlib/clibffi.py b/rpython/rlib/clibffi.py
--- a/rpython/rlib/clibffi.py
+++ b/rpython/rlib/clibffi.py
@@ -12,7 +12,7 @@
from rpython.rlib.rdynload import DLOpenError, DLLHANDLE
from rpython.rlib import jit
from rpython.rlib.objectmodel import specialize
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import platform
import py
@@ -122,7 +122,7 @@
])
else:
USE_C_LIBFFI_MSVC = True
- libffidir = py.path.local(rpythondir).join('translator', 'c', 'src',
'libffi_msvc')
+ libffidir = py.path.local(pypydir).join('translator', 'c', 'src',
'libffi_msvc')
if not _WIN64:
asm_ifc = 'win32.c'
else:
diff --git a/rpython/rlib/parsing/test/autopath.py
b/rpython/rlib/parsing/test/autopath.py
--- a/rpython/rlib/parsing/test/autopath.py
+++ b/rpython/rlib/parsing/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/rlib/rdtoa.py b/rpython/rlib/rdtoa.py
--- a/rpython/rlib/rdtoa.py
+++ b/rpython/rlib/rdtoa.py
@@ -1,13 +1,13 @@
from __future__ import with_statement
from rpython.rlib import rfloat
from rpython.translator.tool.cbuild import ExternalCompilationInfo
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rlib import jit
from rpython.rlib.rstring import StringBuilder
import py, sys
-cdir = py.path.local(rpythondir) / 'translator' / 'c'
+cdir = py.path.local(pypydir) / 'translator' / 'c'
include_dirs = [cdir]
# set the word endianness based on the host's endianness
diff --git a/rpython/rlib/rstack.py b/rpython/rlib/rstack.py
--- a/rpython/rlib/rstack.py
+++ b/rpython/rlib/rstack.py
@@ -14,12 +14,12 @@
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.lltypesystem.lloperation import llop
from rpython.rtyper.controllerentry import Controller, SomeControlledInstance
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.translator.tool.cbuild import ExternalCompilationInfo
# ____________________________________________________________
-srcdir = py.path.local(rpythondir) / 'translator' / 'c' / 'src'
+srcdir = py.path.local(pypydir) / 'translator' / 'c' / 'src'
compilation_info = ExternalCompilationInfo(
includes=['src/stack.h'],
separate_module_files=[srcdir / 'stack.c', srcdir / 'threadlocal.c'])
diff --git a/rpython/rlib/test/autopath.py b/rpython/rlib/test/autopath.py
--- a/rpython/rlib/test/autopath.py
+++ b/rpython/rlib/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/rtyper/lltypesystem/module/ll_math.py
b/rpython/rtyper/lltypesystem/module/ll_math.py
--- a/rpython/rtyper/lltypesystem/module/ll_math.py
+++ b/rpython/rtyper/lltypesystem/module/ll_math.py
@@ -5,7 +5,7 @@
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.tool.sourcetools import func_with_new_name
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.rlib import jit, rposix
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import platform
@@ -25,7 +25,7 @@
else:
eci = ExternalCompilationInfo()
# Some math functions are C99 and not defined by the Microsoft compiler
- cdir = py.path.local(rpythondir).join('translator', 'c')
+ cdir = py.path.local(pypydir).join('translator', 'c')
math_eci = ExternalCompilationInfo(
include_dirs = [cdir],
includes = ['src/ll_math.h'],
diff --git a/rpython/rtyper/module/ll_strtod.py
b/rpython/rtyper/module/ll_strtod.py
--- a/rpython/rtyper/module/ll_strtod.py
+++ b/rpython/rtyper/module/ll_strtod.py
@@ -3,17 +3,17 @@
from rpython.rtyper.extfunc import BaseLazyRegistering, extdef, registering
from rpython.rlib import rfloat
from rpython.rtyper.lltypesystem import lltype, rffi
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.rtyper.ootypesystem import ootype
from rpython.rlib import rposix
from rpython.translator.tool.cbuild import ExternalCompilationInfo
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.annotator.model import SomeString
class CConfig:
_compilation_info_ = ExternalCompilationInfo(
includes = ['src/ll_strtod.h'],
- include_dirs = [str(py.path.local(rpythondir).join('translator',
'c'))],
+ include_dirs = [str(py.path.local(pypydir).join('translator', 'c'))],
separate_module_sources = ['#include <src/ll_strtod.c>'],
export_symbols = ['LL_strtod_formatd', 'LL_strtod_parts_to_float'],
)
diff --git a/rpython/rtyper/tool/rffi_platform.py
b/rpython/rtyper/tool/rffi_platform.py
--- a/rpython/rtyper/tool/rffi_platform.py
+++ b/rpython/rtyper/tool/rffi_platform.py
@@ -11,7 +11,7 @@
from rpython.translator.tool.cbuild import ExternalCompilationInfo
from rpython.translator.platform import CompilationError
from rpython.tool.udir import udir
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.rlib.rarithmetic import r_uint, r_longlong, r_ulonglong, intmask
# ____________________________________________________________
@@ -738,7 +738,7 @@
# ____________________________________________________________
-PYPY_EXTERNAL_DIR = py.path.local(rpythondir).join('..', '..')
+PYPY_EXTERNAL_DIR = py.path.local(pypydir).join('..', '..')
# XXX make this configurable
if sys.platform == 'win32':
for libdir in [
diff --git a/rpython/tool/algo/test/autopath.py
b/rpython/tool/algo/test/autopath.py
--- a/rpython/tool/algo/test/autopath.py
+++ b/rpython/tool/algo/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('pypy')
+pypydir, this_dir = __dirinfo('pypy')
if __name__ == '__main__':
__clone()
diff --git a/rpython/tool/autopath.py b/rpython/tool/autopath.py
deleted file mode 100644
--- a/rpython/tool/autopath.py
+++ /dev/null
@@ -1,131 +0,0 @@
-"""
-self cloning, automatic path configuration
-
-copy this into any subdirectory of pypy from which scripts need
-to be run, typically all of the test subdirs.
-The idea is that any such script simply issues
-
- import autopath
-
-and this will make sure that the parent directory containing "pypy"
-is in sys.path.
-
-If you modify the master "autopath.py" version (in pypy/tool/autopath.py)
-you can directly run it which will copy itself on all autopath.py files
-it finds under the pypy root directory.
-
-This module always provides these attributes:
-
- rpythondir rpython root directory path
- this_dir directory where this autopath.py resides
-
-"""
-
-def __dirinfo(part):
- """ return (partdir, this_dir) and insert parent of partdir
- into sys.path. If the parent directories don't have the part
- an EnvironmentError is raised."""
-
- import sys, os
- try:
- head = this_dir = os.path.realpath(os.path.dirname(__file__))
- except NameError:
- head = this_dir = os.path.realpath(os.path.dirname(sys.argv[0]))
-
- error = None
- while head:
- partdir = head
- head, tail = os.path.split(head)
- if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
- if not os.path.exists(checkfile):
- error = "Cannot find %r" % (os.path.normpath(checkfile),)
- break
- else:
- error = "Cannot find the parent directory %r of the path %r" % (
- partdir, this_dir)
- if not error:
- # check for bogus end-of-line style (e.g. files checked out on
- # Windows and moved to Unix)
- f = open(__file__.replace('.pyc', '.py'), 'r')
- data = f.read()
- f.close()
- if data.endswith('\r\n') or data.endswith('\r'):
- error = ("Bad end-of-line style in the .py files. Typically "
- "caused by a zip file or a checkout done on Windows and "
- "moved to Unix or vice-versa.")
- if error:
- raise EnvironmentError("Invalid source tree - bogus checkout! " +
- error)
-
- pypy_root = os.path.join(head, '')
- try:
- sys.path.remove(head)
- except ValueError:
- pass
- sys.path.insert(0, head)
-
- munged = {}
- for name, mod in sys.modules.items():
- if '.' in name:
- continue
- fn = getattr(mod, '__file__', None)
- if not isinstance(fn, str):
- continue
- newname = os.path.splitext(os.path.basename(fn))[0]
- if not newname.startswith(part + '.'):
- continue
- path = os.path.join(os.path.dirname(os.path.realpath(fn)), '')
- if path.startswith(pypy_root) and newname != part:
- modpaths = os.path.normpath(path[len(pypy_root):]).split(os.sep)
- if newname != '__init__':
- modpaths.append(newname)
- modpath = '.'.join(modpaths)
- if modpath not in sys.modules:
- munged[modpath] = mod
-
- for name, mod in munged.iteritems():
- if name not in sys.modules:
- sys.modules[name] = mod
- if '.' in name:
- prename = name[:name.rfind('.')]
- postname = name[len(prename)+1:]
- if prename not in sys.modules:
- __import__(prename)
- if not hasattr(sys.modules[prename], postname):
- setattr(sys.modules[prename], postname, mod)
-
- return partdir, this_dir
-
-def __clone():
- """ clone master version of autopath.py into all subdirs """
- from os.path import join, walk
- if not this_dir.endswith(join('pypy','tool')):
- raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
-
-
- def sync_walker(arg, dirname, fnames):
- if _myname in fnames:
- fn = join(dirname, _myname)
- f = open(fn, 'rwb+')
- try:
- if f.read() == arg:
- print "checkok", fn
- else:
- print "syncing", fn
- f = open(fn, 'w')
- f.write(arg)
- finally:
- f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
-
-_myname = 'autopath.py'
-
-# set guaranteed attributes
-
-rpythondir, this_dir = __dirinfo('pypy')
-
-if __name__ == '__main__':
- __clone()
diff --git a/rpython/translator/autopath.py b/rpython/translator/autopath.py
--- a/rpython/translator/autopath.py
+++ b/rpython/translator/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/c/autopath.py b/rpython/translator/c/autopath.py
--- a/rpython/translator/c/autopath.py
+++ b/rpython/translator/c/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/c/gcc/autopath.py
b/rpython/translator/c/gcc/autopath.py
--- a/rpython/translator/c/gcc/autopath.py
+++ b/rpython/translator/c/gcc/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -132,7 +132,7 @@
self.secondary_entrypoints = secondary_entrypoints
def get_eci(self):
- pypy_include_dir =
py.path.local(autopath.rpythondir).join('translator', 'c')
+ pypy_include_dir = py.path.local(autopath.pypydir).join('translator',
'c')
include_dirs = [pypy_include_dir]
return ExternalCompilationInfo(include_dirs=include_dirs)
@@ -754,7 +754,7 @@
defines['PYPY_LONGLONG_BIT'] = LONGLONG_BIT
def add_extra_files(eci):
- srcdir = py.path.local(autopath.rpythondir).join('translator', 'c', 'src')
+ srcdir = py.path.local(autopath.pypydir).join('translator', 'c', 'src')
files = [
srcdir / 'entrypoint.c', # ifdef PYPY_STANDALONE
srcdir / 'allocator.c', # ifdef PYPY_STANDALONE
diff --git a/rpython/translator/c/test/autopath.py
b/rpython/translator/c/test/autopath.py
--- a/rpython/translator/c/test/autopath.py
+++ b/rpython/translator/c/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/c/test/test_standalone.py
b/rpython/translator/c/test/test_standalone.py
--- a/rpython/translator/c/test/test_standalone.py
+++ b/rpython/translator/c/test/test_standalone.py
@@ -10,7 +10,7 @@
from rpython.translator.c.genc import CStandaloneBuilder,
ExternalCompilationInfo
from rpython.annotator.listdef import s_list_of_strings
from rpython.tool.udir import udir
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from pypy.conftest import option
@@ -240,7 +240,7 @@
def test_separate_files(self):
# One file in translator/c/src
- fname = py.path.local(rpythondir).join(
+ fname = py.path.local(pypydir).join(
'translator', 'c', 'src', 'll_strtod.c')
# One file in (another) subdir of the temp directory
diff --git a/rpython/translator/cli/gencli.py b/rpython/translator/cli/gencli.py
--- a/rpython/translator/cli/gencli.py
+++ b/rpython/translator/cli/gencli.py
@@ -92,7 +92,7 @@
if timeout and not sys.platform.startswith('win'):
import os
from pypy.tool import autopath
- watchdog = os.path.join(autopath.rpythondir, 'tool', 'watchdog.py')
+ watchdog = os.path.join(autopath.pypydir, 'tool', 'watchdog.py')
args[:0] = [sys.executable, watchdog, str(float(timeout))]
proc = subprocess.Popen(args, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = proc.communicate()
diff --git a/rpython/translator/cli/test/autopath.py
b/rpython/translator/cli/test/autopath.py
--- a/rpython/translator/cli/test/autopath.py
+++ b/rpython/translator/cli/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/goal/autopath.py
b/rpython/translator/goal/autopath.py
--- a/rpython/translator/goal/autopath.py
+++ b/rpython/translator/goal/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/goal/test2/autopath.py
b/rpython/translator/goal/test2/autopath.py
--- a/rpython/translator/goal/test2/autopath.py
+++ b/rpython/translator/goal/test2/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/goal/test2/test_app_main.py
b/rpython/translator/goal/test2/test_app_main.py
--- a/rpython/translator/goal/test2/test_app_main.py
+++ b/rpython/translator/goal/test2/test_app_main.py
@@ -523,7 +523,7 @@
assert line.rstrip() == 'Not at all. They could be carried.'
print 'A five ounce bird could not carry a one pound coconut.'
""")
- py_py = os.path.join(autopath.rpythondir, 'bin', 'py.py')
+ py_py = os.path.join(autopath.pypydir, 'bin', 'py.py')
child = self._spawn(sys.executable, [py_py, '-S', path])
child.expect('Are you suggesting coconuts migrate?', timeout=120)
child.sendline('Not at all. They could be carried.')
@@ -850,7 +850,7 @@
self.w_goal_dir = self.space.wrap(goal_dir)
self.w_fake_exe = self.space.wrap(str(fake_exe))
self.w_expected_path = self.space.wrap(expected_path)
- self.w_trunkdir = self.space.wrap(os.path.dirname(autopath.rpythondir))
+ self.w_trunkdir = self.space.wrap(os.path.dirname(autopath.pypydir))
#
foo_py = prefix.join('foo.py').write("pass")
self.w_foo_py = self.space.wrap(str(foo_py))
diff --git a/rpython/translator/goal/translate.py
b/rpython/translator/goal/translate.py
--- a/rpython/translator/goal/translate.py
+++ b/rpython/translator/goal/translate.py
@@ -12,7 +12,7 @@
import py
# clean up early pypy/_cache
try:
- py.path.local(autopath.rpythondir).join('_cache').remove()
+ py.path.local(autopath.pypydir).join('_cache').remove()
except Exception:
pass
diff --git a/rpython/translator/platform/posix.py
b/rpython/translator/platform/posix.py
--- a/rpython/translator/platform/posix.py
+++ b/rpython/translator/platform/posix.py
@@ -88,7 +88,7 @@
if path is None:
path = cfiles[0].dirpath()
- pypypath = py.path.local(autopath.rpythondir)
+ pypypath = py.path.local(autopath.pypydir)
if exe_name is None:
exe_name = cfiles[0].new(ext=self.exe_ext)
@@ -139,7 +139,7 @@
m.comment('automatically generated makefile')
definitions = [
- ('PYPYDIR', '"%s"' % autopath.rpythondir),
+ ('PYPYDIR', '"%s"' % autopath.pypydir),
('TARGET', target_name),
('DEFAULT_TARGET', exe_name.basename),
('SOURCES', rel_cfiles),
diff --git a/rpython/translator/platform/windows.py
b/rpython/translator/platform/windows.py
--- a/rpython/translator/platform/windows.py
+++ b/rpython/translator/platform/windows.py
@@ -252,7 +252,7 @@
if path is None:
path = cfiles[0].dirpath()
- pypypath = py.path.local(autopath.rpythondir)
+ pypypath = py.path.local(autopath.pypydir)
if exe_name is None:
exe_name = cfiles[0].new(ext=self.exe_ext)
@@ -294,7 +294,7 @@
m.comment('automatically generated makefile')
definitions = [
- ('PYPYDIR', autopath.rpythondir),
+ ('PYPYDIR', autopath.pypydir),
('TARGET', target_name),
('DEFAULT_TARGET', exe_name.basename),
('SOURCES', rel_cfiles),
diff --git a/rpython/translator/sandbox/autopath.py
b/rpython/translator/sandbox/autopath.py
--- a/rpython/translator/sandbox/autopath.py
+++ b/rpython/translator/sandbox/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/sandbox/test/autopath.py
b/rpython/translator/sandbox/test/autopath.py
--- a/rpython/translator/sandbox/test/autopath.py
+++ b/rpython/translator/sandbox/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/test/autopath.py
b/rpython/translator/test/autopath.py
--- a/rpython/translator/test/autopath.py
+++ b/rpython/translator/test/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/tool/autopath.py
b/rpython/translator/tool/autopath.py
--- a/rpython/translator/tool/autopath.py
+++ b/rpython/translator/tool/autopath.py
@@ -16,7 +16,7 @@
This module always provides these attributes:
- rpythondir rpython root directory path
+ pypydir pypy root directory path
this_dir directory where this autopath.py resides
"""
@@ -37,7 +37,7 @@
partdir = head
head, tail = os.path.split(head)
if tail == part:
- checkfile = os.path.join(partdir, os.pardir, 'rpython',
'__init__.py')
+ checkfile = os.path.join(partdir, os.pardir, 'pypy', '__init__.py')
if not os.path.exists(checkfile):
error = "Cannot find %r" % (os.path.normpath(checkfile),)
break
@@ -102,7 +102,7 @@
from os.path import join, walk
if not this_dir.endswith(join('pypy','tool')):
raise EnvironmentError("can only clone master version "
- "'%s'" % join(rpythondir, 'tool',_myname))
+ "'%s'" % join(pypydir, 'tool',_myname))
def sync_walker(arg, dirname, fnames):
@@ -118,14 +118,14 @@
f.write(arg)
finally:
f.close()
- s = open(join(rpythondir, 'tool', _myname), 'rb').read()
- walk(rpythondir, sync_walker, s)
+ s = open(join(pypydir, 'tool', _myname), 'rb').read()
+ walk(pypydir, sync_walker, s)
_myname = 'autopath.py'
# set guaranteed attributes
-rpythondir, this_dir = __dirinfo('rpython')
+pypydir, this_dir = __dirinfo('rpython')
if __name__ == '__main__':
__clone()
diff --git a/rpython/translator/tool/cbuild.py
b/rpython/translator/tool/cbuild.py
--- a/rpython/translator/tool/cbuild.py
+++ b/rpython/translator/tool/cbuild.py
@@ -1,7 +1,7 @@
import py
import sys
-from rpython.tool.autopath import rpythondir
+from pypy.tool.autopath import pypydir
from rpython.translator.platform import host
from rpython.tool.udir import udir
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit