Amaury Forgeot d'Arc  committed 460b29c

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

  • Participants
  • Parent commits a0beb6e
  • Branches py3k

Comments (0)

Files changed (2)

File pypy/annotation/

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

File pypy/module/imp/

 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
         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."
     # -> __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 -> (...)/