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
40a0061c
Commit
40a0061c
authored
Nov 05, 2010
by
Antoine Pitrou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bootstrap issues when building without threads
parent
2156f7b2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
Lib/_dummy_thread.py
Lib/_dummy_thread.py
+8
-4
Lib/reprlib.py
Lib/reprlib.py
+1
-1
No files found.
Lib/_dummy_thread.py
View file @
40a0061c
...
...
@@ -16,12 +16,14 @@ Suggested usage is::
__all__
=
[
'error'
,
'start_new_thread'
,
'exit'
,
'get_ident'
,
'allocate_lock'
,
'interrupt_main'
,
'LockType'
]
import
traceback
as
_traceback
import
time
# A dummy value
TIMEOUT_MAX
=
2
**
31
# NOTE: this module can be imported early in the extension building process,
# and so top level imports of other modules should be avoided. Instead, all
# imports are done when needed on a function-by-function basis. Since threads
# are disabled, the import lock should not be an issue anyway (??).
class
error
(
Exception
):
"""Dummy implementation of _thread.error."""
...
...
@@ -52,7 +54,8 @@ def start_new_thread(function, args, kwargs={}):
except
SystemExit
:
pass
except
:
_traceback
.
print_exc
()
import
traceback
traceback
.
print_exc
()
_main
=
True
global
_interrupt
if
_interrupt
:
...
...
@@ -116,6 +119,7 @@ class LockType(object):
return
True
else
:
if
timeout
>
0
:
import
time
time
.
sleep
(
timeout
)
return
False
...
...
Lib/reprlib.py
View file @
40a0061c
...
...
@@ -6,7 +6,7 @@ import builtins
from
itertools
import
islice
try
:
from
_thread
import
get_ident
except
Attribute
Error
:
except
Import
Error
:
from
_dummy_thread
import
get_ident
def
recursive_repr
(
fillvalue
=
'...'
):
...
...
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