Author: Amaury Forgeot d'Arc <[email protected]>
Branch: py3k
Changeset: r59362:460b29c967c1
Date: 2012-12-07 18:31 +0100
http://bitbucket.org/pypy/pypy/changeset/460b29c967c1/

Log:    Use @signature, in a place that would have saved time to find the
        translation failure.

diff --git a/pypy/annotation/types.py b/pypy/annotation/types.py
--- a/pypy/annotation/types.py
+++ b/pypy/annotation/types.py
@@ -24,9 +24,15 @@
 def unicode():
     return model.SomeUnicodeString()
 
+def unicode0():
+    return model.SomeUnicodeString(no_nul=True)
+
 def str():
     return model.SomeString()
 
+def str0():
+    return model.SomeString(no_nul=True)
+
 def char():
     return model.SomeChar()
 
diff --git a/pypy/module/imp/importing.py b/pypy/module/imp/importing.py
--- a/pypy/module/imp/importing.py
+++ b/pypy/module/imp/importing.py
@@ -4,6 +4,7 @@
 
 import sys, os, stat
 
+from pypy.annotation import types
 from pypy.interpreter.module import Module
 from pypy.interpreter.gateway import interp2app, unwrap_spec
 from pypy.interpreter.typedef import TypeDef, generic_new_descr
@@ -14,6 +15,7 @@
 from pypy.rlib import streamio, jit
 from pypy.rlib.streamio import StreamErrors
 from pypy.rlib.objectmodel import we_are_translated, specialize
+from pypy.rlib.signature import signature
 from pypy.module.sys.version import PYPY_VERSION
 
 SEARCH_ERROR = 0
@@ -871,6 +873,7 @@
         index = max(index, index2)
     return index
 
+@signature(types.str0(), returns=types.str0())
 def make_compiled_pathname(pathname):
     "Given the path to a .py file, return the path to its .pyc file."
     # foo.py -> __pycache__/foo.<tag>.pyc
@@ -893,6 +896,7 @@
               ext + PYC_TAG + '.pyc')
     return result
 
+@signature(types.str0(), returns=types.str0())
 def make_source_pathname(pathname):
     "Given the path to a .pyc file, return the path to its .py file."
     # (...)/__pycache__/foo.<tag>.pyc -> (...)/foo.py
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to