Silence a py3k warning.

This commit is contained in:
Ezio Melotti 2010-03-31 08:33:50 +00:00
parent eb72991fbb
commit fcc500ebc4

View file

@ -593,9 +593,12 @@ class TestGetcallargsFunctions(unittest.TestCase):
def makeCallable(self, signature):
"""Create a function that returns its locals(), excluding the
autogenerated '.1', '.2', etc. tuple param names (if any)."""
code = ("lambda %s: dict(i for i in locals().items() "
"if not is_tuplename(i[0]))")
return eval(code % signature, {'is_tuplename' : self.is_tuplename})
with check_py3k_warnings(
("tuple parameter unpacking has been removed", SyntaxWarning),
quiet=True):
code = ("lambda %s: dict(i for i in locals().items() "
"if not is_tuplename(i[0]))")
return eval(code % signature, {'is_tuplename' : self.is_tuplename})
def test_plain(self):
f = self.makeCallable('a, b=1')