Author: Alex Gaynor <[email protected]>
Branch:
Changeset: r57806:69e8fe5fc905
Date: 2012-10-07 03:46 -0700
http://bitbucket.org/pypy/pypy/changeset/69e8fe5fc905/
Log: Include the root of the module name in the files that are generated
by translation.
diff --git a/pypy/rlib/rsre/rsre_re.py b/pypy/rlib/rsre/rsre_re.py
--- a/pypy/rlib/rsre/rsre_re.py
+++ b/pypy/rlib/rsre/rsre_re.py
@@ -75,7 +75,7 @@
else:
item = match.groups("")
matchlist.append(item)
- return matchlist
+ return matchlist
def finditer(self, string, pos=0, endpos=sys.maxint):
return iter(self.scanner(string, pos, endpos).search, None)
diff --git a/pypy/translator/c/genc.py b/pypy/translator/c/genc.py
--- a/pypy/translator/c/genc.py
+++ b/pypy/translator/c/genc.py
@@ -701,7 +701,7 @@
localpath = py.path.local(g.filename)
pypkgpath = localpath.pypkgpath()
if pypkgpath:
- relpypath = localpath.relto(pypkgpath)
+ relpypath = localpath.relto(pypkgpath.dirname)
return relpypath.replace('.py', '.c')
return None
if hasattr(node.obj, 'graph'):
diff --git a/pypy/translator/c/test/test_dlltool.py
b/pypy/translator/c/test/test_dlltool.py
--- a/pypy/translator/c/test/test_dlltool.py
+++ b/pypy/translator/c/test/test_dlltool.py
@@ -28,4 +28,4 @@
d = DLLDef('lib', [(f, [int]), (b, [int])])
so = d.compile()
dirpath = py.path.local(so).dirpath()
- assert dirpath.join('translator_c_test_test_dlltool.c').check()
+ assert dirpath.join('pypy_translator_c_test_test_dlltool.c').check()
diff --git a/pypy/translator/c/test/test_standalone.py
b/pypy/translator/c/test/test_standalone.py
--- a/pypy/translator/c/test/test_standalone.py
+++ b/pypy/translator/c/test/test_standalone.py
@@ -57,9 +57,9 @@
# Verify that the generated C files have sane names:
gen_c_files = [str(f) for f in cbuilder.extrafiles]
- for expfile in ('rlib_rposix.c',
- 'rpython_lltypesystem_rstr.c',
- 'translator_c_test_test_standalone.c'):
+ for expfile in ('pypy_rlib_rposix.c',
+ 'pypy_rpython_lltypesystem_rstr.c',
+ 'pypy_translator_c_test_test_standalone.c'):
assert cbuilder.targetdir.join(expfile) in gen_c_files
def test_print(self):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit