Author: mattip <[email protected]>
Branch: release-2.5.x
Changeset: r76372:8e24dac0b8e2
Date: 2015-03-14 20:05 +0200
http://bitbucket.org/pypy/pypy/changeset/8e24dac0b8e2/

Log:    merge default into branch

diff --git a/pypy/interpreter/pycode.py b/pypy/interpreter/pycode.py
--- a/pypy/interpreter/pycode.py
+++ b/pypy/interpreter/pycode.py
@@ -4,7 +4,7 @@
 The bytecode interpreter itself is implemented by the PyFrame class.
 """
 
-import dis, imp, struct, types, new, sys
+import dis, imp, struct, types, new, sys, os
 
 from pypy.interpreter import eval
 from pypy.interpreter.signature import Signature
@@ -128,6 +128,15 @@
         if (self.magic == cpython_magic and
             '__pypy__' not in sys.builtin_module_names):
             raise Exception("CPython host codes should not be rendered")
+        # When translating PyPy, freeze the file name
+        #     <builtin>/lastdirname/basename.py
+        # instead of freezing the complete translation-time path.
+        filename = self.co_filename.lstrip('<').rstrip('>')
+        if filename.lower().endswith('.pyc'):
+            filename = filename[:-1]
+        basename = os.path.basename(filename)
+        lastdirname = os.path.basename(os.path.dirname(filename))
+        self.co_filename = '<builtin>/%s/%s' % (lastdirname, basename)
 
     co_names = property(lambda self: [self.space.unwrap(w_name) for w_name in 
self.co_names_w]) # for trace
 
diff --git a/rpython/translator/c/src/mem.c b/rpython/translator/c/src/mem.c
--- a/rpython/translator/c/src/mem.c
+++ b/rpython/translator/c/src/mem.c
@@ -29,9 +29,9 @@
 RPY_EXTERN
 void pypy_debug_alloc_stop(void *addr)
 {
+  struct pypy_debug_alloc_s **p;
   if (!addr)
        return;
-  struct pypy_debug_alloc_s **p;
   for (p = &pypy_debug_alloc_list; *p; p = &((*p)->next))
     if ((*p)->addr == addr)
       {
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to