summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2011-09-28 07:22:13 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2011-09-28 07:22:13 (GMT)
commitf02aa65acb7b1b66ac7898680e5a6817c380f7eb (patch)
tree44f1ce692a6637e040bec88d803c6d383b2de92e /Lib
parent0c9fe4d109a94d1a923991d223ab60fbce8420f5 (diff)
downloadcpython-f02aa65acb7b1b66ac7898680e5a6817c380f7eb.zip
cpython-f02aa65acb7b1b66ac7898680e5a6817c380f7eb.tar.gz
cpython-f02aa65acb7b1b66ac7898680e5a6817c380f7eb.tar.bz2
Use compile() instead of eval().
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_sys.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py
index 9554eef..0b7bbf1 100644
--- a/Lib/test/test_sys.py
+++ b/Lib/test/test_sys.py
@@ -856,12 +856,10 @@ class SizeofTest(unittest.TestCase):
# verify that the UTF-8 size is accounted for
s = chr(0x4000) # 4 bytes canonical representation
check(s, size(compactfields) + 4)
- try:
- # eval() will trigger the generation of the UTF-8 representation
- # as a side effect
- eval(s)
- except NameError:
- check(s, size(compactfields) + 4 + 4)
+ # compile() will trigger the generation of the UTF-8
+ # representation as a side effect
+ compile(s, "<stdin>", "eval")
+ check(s, size(compactfields) + 4 + 4)
# TODO: add check that forces the presence of wchar_t representation
# TODO: add check that forces layout of unicodefields
# weakref