Commits

Amaury Forgeot d'Arc committed 565ca46

Add token.__all__, and fix applevel raises when a string is passed to be compiled.

Comments (0)

Files changed (2)

pypy/module/token/__init__.py

         tok_name[id] = tok
     Module.interpleveldefs["tok_name"] = "space.wrap(%r)" % (tok_name,)
     Module.interpleveldefs["N_TOKENS"] = "space.wrap(%d)" % len(tok_name)
+    all_names = Module.interpleveldefs.keys()
+    Module.interpleveldefs["__all__"] = "space.wrap(%r)" % (all_names,)
 
 _init_tokens()
 

pypy/tool/pytest/appsupport.py

 def pypyraises(space, w_ExpectedException, w_expr, __args__):
     """A built-in function providing the equivalent of py.test.raises()."""
     args_w, kwds_w = __args__.unpack()
-    if space.is_true(space.isinstance(w_expr, space.w_str)):
+    if space.is_true(space.isinstance(w_expr, space.w_unicode)):
         if args_w:
             raise OperationError(space.w_TypeError,
                                  space.wrap("raises() takes no argument "