diff --git a/src/wrapt/arguments.py b/src/wrapt/arguments.py index 2537916..428ffae 100644 --- a/src/wrapt/arguments.py +++ b/src/wrapt/arguments.py @@ -4,6 +4,7 @@ # of the PSF license used for Python 2.7. from inspect import getargspec, ismethod +import sys def getcallargs(func, *positional, **named): """Get the mapping of arguments to values. diff --git a/tests/test_arguments.py b/tests/test_arguments.py index 5c688ec..0b7379d 100644 --- a/tests/test_arguments.py +++ b/tests/test_arguments.py @@ -21,3 +21,10 @@ class TestArguments(unittest.TestCase): calculated = wrapt.getcallargs(function, 10, 20, 30, 40, 50, 60) self.assertEqual(expected, calculated) + + def test_unexpected_unicode_keyword(self): + def function(a=2): + pass + + kwargs = { u'b': 40 } + self.assertRaises(TypeError, wrapt.getcallargs, function, **kwargs)