Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f02aa65a
Commit
f02aa65a
authored
Sep 28, 2011
by
Martin v. Löwis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use compile() instead of eval().
parent
0c9fe4d1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
6 deletions
+4
-6
Lib/test/test_sys.py
Lib/test/test_sys.py
+4
-6
No files found.
Lib/test/test_sys.py
View file @
f02aa65a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment