mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Removed some unused imports to decrease the amount of loaded modules during startup.
Added fallback to _dummy_thread for OSs w/o thread support.
This commit is contained in:
parent
34ed9f7c5e
commit
deb75f579b
2 changed files with 6 additions and 3 deletions
|
@ -60,8 +60,12 @@ import abc
|
||||||
import sys
|
import sys
|
||||||
import codecs
|
import codecs
|
||||||
import _fileio
|
import _fileio
|
||||||
import warnings
|
# Import _thread instead of threading to reduce startup cost
|
||||||
|
try:
|
||||||
from _thread import allocate_lock as Lock
|
from _thread import allocate_lock as Lock
|
||||||
|
except ImportError:
|
||||||
|
from _dummy_thread import allocate_lock as Lock
|
||||||
|
|
||||||
|
|
||||||
# open() uses st_blksize whenever we can
|
# open() uses st_blksize whenever we can
|
||||||
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
|
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
|
||||||
|
|
|
@ -5,7 +5,6 @@
|
||||||
# See bug 683658.
|
# See bug 683658.
|
||||||
import linecache
|
import linecache
|
||||||
import sys
|
import sys
|
||||||
import types
|
|
||||||
|
|
||||||
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
|
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
|
||||||
"resetwarnings"]
|
"resetwarnings"]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue