diff options
author | Christian Heimes <christian@cheimes.de> | 2008-08-15 18:43:03 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2008-08-15 18:43:03 (GMT) |
commit | deb75f579b597d996734f66f93a2303bc7ac4fab (patch) | |
tree | 5b899bfb080a8bcd943e58ad41a6c18ced35a162 /Lib/io.py | |
parent | 34ed9f7c5e22f8c5ebf38edff64f88842dfba245 (diff) | |
download | cpython-deb75f579b597d996734f66f93a2303bc7ac4fab.zip cpython-deb75f579b597d996734f66f93a2303bc7ac4fab.tar.gz cpython-deb75f579b597d996734f66f93a2303bc7ac4fab.tar.bz2 |
Removed some unused imports to decrease the amount of loaded modules during startup.
Added fallback to _dummy_thread for OSs w/o thread support.
Diffstat (limited to 'Lib/io.py')
-rw-r--r-- | Lib/io.py | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |