summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/io.py8
-rw-r--r--Lib/warnings.py1
2 files changed, 6 insertions, 3 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 18680ca..4fe1e8c 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -60,8 +60,12 @@ import abc
import sys
import codecs
import _fileio
-import warnings
-from _thread import allocate_lock as Lock
+# Import _thread instead of threading to reduce startup cost
+try:
+ from _thread import allocate_lock as Lock
+except ImportError:
+ from _dummy_thread import allocate_lock as Lock
+
# open() uses st_blksize whenever we can
DEFAULT_BUFFER_SIZE = 8 * 1024 # bytes
diff --git a/Lib/warnings.py b/Lib/warnings.py
index bcd702c..0be20e0 100644
--- a/Lib/warnings.py
+++ b/Lib/warnings.py
@@ -5,7 +5,6 @@
# See bug 683658.
import linecache
import sys
-import types
__all__ = ["warn", "showwarning", "formatwarning", "filterwarnings",
"resetwarnings"]