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
10e35b30
Commit
10e35b30
authored
Jul 20, 2009
by
Brett Cannon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backport of r74103.
parent
5797e8b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
Lib/importlib/test/source/test_abc_loader.py
Lib/importlib/test/source/test_abc_loader.py
+8
-8
Misc/NEWS
Misc/NEWS
+6
-0
No files found.
Lib/importlib/test/source/test_abc_loader.py
View file @
10e35b30
...
...
@@ -346,20 +346,20 @@ class BadBytecodeFailureTests(unittest.TestCase):
# A bad magic number should lead to an ImportError.
name
=
'mod'
bad_magic
=
b'
\
x00
\
x00
\
x00
\
x00
'
mock
=
PyPycLoaderMock
({
},
{
name
:
{
'path'
:
os
.
path
.
join
(
'path'
,
'to'
,
'mod'
),
'magic'
:
bad_magic
}})
mock
=
PyPycLoaderMock
({
name
:
None
}
,
{
name
:
{
'path'
:
os
.
path
.
join
(
'path'
,
'to'
,
'mod'
),
'magic'
:
bad_magic
}})
with
util
.
uncache
(
name
):
self
.
assertRaises
(
ImportError
,
mock
.
load_module
,
name
)
def
test_bad_bytecode
(
self
):
# Bad code object bytecode should
el
ad to an ImportError.
# Bad code object bytecode should
le
ad to an ImportError.
name
=
'mod'
mock
=
PyPycLoaderMock
({
},
{
name
:
{
'path'
:
os
.
path
.
join
(
'path'
,
'to'
,
'mod'
),
'bc'
:
b''
}})
mock
=
PyPycLoaderMock
({
name
:
None
}
,
{
name
:
{
'path'
:
os
.
path
.
join
(
'path'
,
'to'
,
'mod'
),
'bc'
:
b''
}})
with
util
.
uncache
(
name
):
self
.
assertRaises
(
Import
Error
,
mock
.
load_module
,
name
)
self
.
assertRaises
(
EOF
Error
,
mock
.
load_module
,
name
)
def
raise_ImportError
(
*
args
,
**
kwargs
):
...
...
Misc/NEWS
View file @
10e35b30
...
...
@@ -62,6 +62,12 @@ Build
- Issue 5390: Add uninstall icon independent of whether file
extensions are installed.
Test
----
- Fix a test in importlib.test.source.test_abc_loader that was incorrectly
testing when a .pyc file lacked an code object bytecode.
What's New in Python 3.1?
=========================
...
...
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