summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_new.py
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2007-02-25 20:55:47 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2007-02-25 20:55:47 (GMT)
commit221085de89afa861c49ff4306979dbbad949d393 (patch)
tree3e79f6c14311cba733d5f8d1a1e2c227d238fd51 /Lib/test/test_new.py
parent27d517b21b67b54637acd19785f7adfc38fbd8c2 (diff)
downloadcpython-221085de89afa861c49ff4306979dbbad949d393.zip
cpython-221085de89afa861c49ff4306979dbbad949d393.tar.gz
cpython-221085de89afa861c49ff4306979dbbad949d393.tar.bz2
Change all the function attributes from func_* -> __*__. This gets rid
of func_name, func_dict and func_doc as they already exist as __name__, __dict__ and __doc__.
Diffstat (limited to 'Lib/test/test_new.py')
-rw-r--r--Lib/test/test_new.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/test/test_new.py b/Lib/test/test_new.py
index e2d26fa..797a8c3 100644
--- a/Lib/test/test_new.py
+++ b/Lib/test/test_new.py
@@ -79,18 +79,18 @@ class NewTest(unittest.TestCase):
return x + y
return g
g = f(4)
- new.function(f.func_code, {}, "blah")
- g2 = new.function(g.func_code, {}, "blah", (2,), g.func_closure)
+ new.function(f.__code__, {}, "blah")
+ g2 = new.function(g.__code__, {}, "blah", (2,), g.__closure__)
self.assertEqual(g2(), 6)
- g3 = new.function(g.func_code, {}, "blah", None, g.func_closure)
+ g3 = new.function(g.__code__, {}, "blah", None, g.__closure__)
self.assertEqual(g3(5), 9)
def test_closure(func, closure, exc):
- self.assertRaises(exc, new.function, func.func_code, {}, "", None, closure)
+ self.assertRaises(exc, new.function, func.__code__, {}, "", None, closure)
test_closure(g, None, TypeError) # invalid closure
test_closure(g, (1,), TypeError) # non-cell in closure
test_closure(g, (1, 1), ValueError) # closure is wrong size
- test_closure(f, g.func_closure, ValueError) # no closure needed
+ test_closure(f, g.__closure__, ValueError) # no closure needed
# Note: Jython will never have new.code()
if hasattr(new, 'code'):
@@ -98,7 +98,7 @@ class NewTest(unittest.TestCase):
# bogus test of new.code()
def f(a): pass
- c = f.func_code
+ c = f.__code__
argcount = c.co_argcount
kwonlyargcount = c.co_kwonlyargcount
nlocals = c.co_nlocals