Commits

Amaury Forgeot d'Arc committed 460b29c

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

Comments (0)

Files changed (2)

pypy/annotation/types.py

 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()
 

pypy/module/imp/importing.py

 
 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
 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
         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
               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