Commits

Antonio Cuni committed aba5b32

two more annotation-time checks

Comments (0)

Files changed (1)

pypy/module/__builtin__/compiling.py

 from pypy.interpreter.error import OperationError
 from pypy.interpreter.astcompiler import consts, ast
 from pypy.interpreter.gateway import unwrap_spec
-from pypy.interpreter.argument import Arguments
+from pypy.interpreter.argument import Arguments, assert_list_of_unicode
 from pypy.interpreter.nestedscope import Cell
 
 @unwrap_spec(filename=str, mode=str, flags=int, dont_inherit=int, optimize=int)
             raise
         w_namespace = space.newdict()
     else:
+        keywords = kwds_w.keys()
+        assert_list_of_unicode(keywords)
         args = Arguments(space, 
                          args_w=[w_name, w_bases],
-                         keywords=kwds_w.keys(),
+                         keywords=keywords,
                          keywords_w=kwds_w.values())
         w_namespace = space.call_args(w_prep, args)
     w_cell = space.call_function(w_func, w_namespace)
+    keywords = kwds_w.keys()
+    assert_list_of_unicode(keywords)
     args = Arguments(space,
                      args_w=[w_name, w_bases, w_namespace],
-                     keywords=kwds_w.keys(),
+                     keywords=keywords,
                      keywords_w=kwds_w.values())
     w_class = space.call_args(w_meta, args)
     if isinstance(w_cell, Cell):