diff options
author | Christian Heimes <christian@cheimes.de> | 2013-10-11 23:27:08 (GMT) |
---|---|---|
committer | Christian Heimes <christian@cheimes.de> | 2013-10-11 23:27:08 (GMT) |
commit | 2582762b1b76a9bbe11f8ba5fc2a350157526050 (patch) | |
tree | 2842450f57aa729c32fdba59c98558f0ad324650 /Lib/os.py | |
parent | 1a5fb4e3c1d99a0abbb9f1e9dd6f9322102ee812 (diff) | |
download | cpython-2582762b1b76a9bbe11f8ba5fc2a350157526050.zip cpython-2582762b1b76a9bbe11f8ba5fc2a350157526050.tar.gz cpython-2582762b1b76a9bbe11f8ba5fc2a350157526050.tar.bz2 |
Issue #19209: Remove import of copyreg from the os module to speed up
interpreter startup. stat_result and statvfs_result are now hard-coded to
reside in the os module.
The patch is based on Victor Stinner's patch.
Diffstat (limited to 'Lib/os.py')
-rw-r--r-- | Lib/os.py | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -945,33 +945,6 @@ otherwise return -SIG, where SIG is the signal that killed it. """ __all__.extend(["spawnlp", "spawnlpe"]) -import copyreg as _copyreg - -def _make_stat_result(tup, dict): - return stat_result(tup, dict) - -def _pickle_stat_result(sr): - (type, args) = sr.__reduce__() - return (_make_stat_result, args) - -try: - _copyreg.pickle(stat_result, _pickle_stat_result, _make_stat_result) -except NameError: # stat_result may not exist - pass - -def _make_statvfs_result(tup, dict): - return statvfs_result(tup, dict) - -def _pickle_statvfs_result(sr): - (type, args) = sr.__reduce__() - return (_make_statvfs_result, args) - -try: - _copyreg.pickle(statvfs_result, _pickle_statvfs_result, - _make_statvfs_result) -except NameError: # statvfs_result may not exist - pass - # Supply os.popen() def popen(cmd, mode="r", buffering=-1): if not isinstance(cmd, str): |