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
448acd0a
Commit
448acd0a
authored
Jul 16, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix possible failure in pickling tests due to different instantiations
of the random module being around.
parent
3b0a19ea
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
Lib/test/test_threaded_import.py
Lib/test/test_threaded_import.py
+10
-0
No files found.
Lib/test/test_threaded_import.py
View file @
448acd0a
...
...
@@ -27,6 +27,16 @@ def task(N, done, done_tasks, errors):
class
ThreadedImportTests
(
unittest
.
TestCase
):
def
setUp
(
self
):
self
.
old_random
=
sys
.
modules
.
pop
(
'random'
,
None
)
def
tearDown
(
self
):
# If the `random` module was already initialized, we restore the
# old module at the end so that pickling tests don't fail.
# See http://bugs.python.org/issue3657#msg110461
if
self
.
old_random
is
not
None
:
sys
.
modules
[
'random'
]
=
self
.
old_random
def
test_parallel_module_init
(
self
):
if
imp
.
lock_held
():
# This triggers on, e.g., from test import autotest.
...
...
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