summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_code.py14
-rw-r--r--Lib/test/test_dis.py10
2 files changed, 10 insertions, 14 deletions
diff --git a/Lib/test/test_code.py b/Lib/test/test_code.py
index 244acab..27342ad 100644
--- a/Lib/test/test_code.py
+++ b/Lib/test/test_code.py
@@ -49,7 +49,7 @@ varnames: ('x', 'y', 'a', 'b', 'c')
cellvars: ()
freevars: ()
nlocals: 5
-flags: 67
+flags: 3
consts: ('None',)
>>> def attrs(obj):
@@ -67,7 +67,7 @@ varnames: ('obj',)
cellvars: ()
freevars: ()
nlocals: 1
-flags: 67
+flags: 3
consts: ('None',)
>>> def optimize_away():
@@ -86,7 +86,7 @@ varnames: ()
cellvars: ()
freevars: ()
nlocals: 0
-flags: 67
+flags: 3
consts: ("'doc string'", 'None')
>>> def keywordonly_args(a,b,*,k1):
@@ -103,7 +103,7 @@ varnames: ('a', 'b', 'k1')
cellvars: ()
freevars: ()
nlocals: 3
-flags: 67
+flags: 3
consts: ('None',)
>>> def posonly_args(a,b,/,c):
@@ -120,7 +120,7 @@ varnames: ('a', 'b', 'c')
cellvars: ()
freevars: ()
nlocals: 3
-flags: 67
+flags: 3
consts: ('None',)
"""
@@ -199,10 +199,6 @@ class CodeTest(unittest.TestCase):
class_ref = function.__closure__[0].cell_contents
self.assertIs(class_ref, List)
- # Ensure the code correctly indicates it accesses a free variable
- self.assertFalse(function.__code__.co_flags & inspect.CO_NOFREE,
- hex(function.__code__.co_flags))
-
# Ensure the zero-arg super() call in the injected method works
obj = List([1, 2, 3])
self.assertEqual(obj[0], "Foreign getitem: 1")
diff --git a/Lib/test/test_dis.py b/Lib/test/test_dis.py
index 41dd939..f2daa17 100644
--- a/Lib/test/test_dis.py
+++ b/Lib/test/test_dis.py
@@ -719,7 +719,7 @@ Positional-only arguments: 0
Kw-only arguments: 0
Number of locals: 1
Stack size: 3
-Flags: OPTIMIZED, NEWLOCALS, NOFREE
+Flags: OPTIMIZED, NEWLOCALS
Constants:
{code_info_consts}
Names:
@@ -800,7 +800,7 @@ Positional-only arguments: 0
Kw-only arguments: 0
Number of locals: 0
Stack size: 2
-Flags: NOFREE
+Flags: 0x0
Constants:
0: 1
Names:
@@ -814,7 +814,7 @@ Positional-only arguments: 0
Kw-only arguments: 0
Number of locals: 0
Stack size: 2
-Flags: NOFREE
+Flags: 0x0
Constants:
0: 1
1: None
@@ -829,7 +829,7 @@ Positional-only arguments: 0
Kw-only arguments: 0
Number of locals: 0
Stack size: 2
-Flags: NOFREE
+Flags: 0x0
Constants:
0: 0
1: 1
@@ -851,7 +851,7 @@ Positional-only arguments: 0
Kw-only arguments: 0
Number of locals: 2
Stack size: 10
-Flags: OPTIMIZED, NEWLOCALS, NOFREE, COROUTINE
+Flags: OPTIMIZED, NEWLOCALS, COROUTINE
Constants:
0: None
1: 1