[pypy-commit] pypy py3k: enforce the list of keywords to be unicode

antocuni noreply at buildbot.pypy.org
Wed Aug 22 12:03:01 CEST 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r56793:ed66f5af8446
Date: 2012-08-22 12:02 +0200
http://bitbucket.org/pypy/pypy/changeset/ed66f5af8446/

Log:	enforce the list of keywords to be unicode

diff --git a/pypy/interpreter/argument.py b/pypy/interpreter/argument.py
--- a/pypy/interpreter/argument.py
+++ b/pypy/interpreter/argument.py
@@ -5,6 +5,7 @@
 from pypy.interpreter.error import OperationError, operationerrfmt
 from pypy.rlib.debug import make_sure_not_resized
 from pypy.rlib import jit
+from pypy.rlib.objectmodel import enforceargs
 
 class Signature(object):
     _immutable_ = True
@@ -114,6 +115,7 @@
     """
 
     ###  Construction  ###
+    @enforceargs(keywords=[unicode])
     def __init__(self, space, args_w, keywords=None, keywords_w=None,
                  w_stararg=None, w_starstararg=None, keyword_names_w=None):
         self.space = space
diff --git a/pypy/interpreter/test/test_argument.py b/pypy/interpreter/test/test_argument.py
--- a/pypy/interpreter/test/test_argument.py
+++ b/pypy/interpreter/test/test_argument.py
@@ -1,4 +1,5 @@
 # -*- coding: utf-8 -*-
+from __future__ import unicode_literals
 import py
 from pypy.interpreter.argument import (Arguments, ArgumentsForTranslation,
     ArgErr, ArgErrUnknownKwds, ArgErrMultipleValues, ArgErrCount, rawshape,
@@ -685,7 +686,7 @@
         assert exc.value.message == "<lambda>() takes exactly 2 non-keyword arguments (0 given)"
 
     def test_unicode_keywords(self):
-        """
+        b"""
         def f(**kwargs):
             assert kwargs["&#32654;"] == 42
         f(**{"&#32654;" : 42})


More information about the pypy-commit mailing list