summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael W. Hudson <mwh@python.net>2002-03-15 10:18:58 (GMT)
committerMichael W. Hudson <mwh@python.net>2002-03-15 10:18:58 (GMT)
commitce00b735cde4e4d0c56e02723fb0b459c403ace3 (patch)
treee2e3ec3e1b8cfd3d0671eb039e6e73ee9fddc943
parentd4233b2b8c985395ccc92482deeb96b92391ff4d (diff)
downloadcpython-ce00b735cde4e4d0c56e02723fb0b459c403ace3.zip
cpython-ce00b735cde4e4d0c56e02723fb0b459c403ace3.tar.gz
cpython-ce00b735cde4e4d0c56e02723fb0b459c403ace3.tar.bz2
Fix
[ 530236 ] os.py assumes existence of statvfs_resul This was pretty dense of me. Sorry. 2.2.1 candidate.
-rw-r--r--Lib/os.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/Lib/os.py b/Lib/os.py
index f411f1f..9d9e059 100644
--- a/Lib/os.py
+++ b/Lib/os.py
@@ -612,7 +612,10 @@ def _pickle_stat_result(sr):
(type, args) = sr.__reduce__()
return (_make_stat_result, args)
-_copy_reg.pickle(stat_result, _pickle_stat_result,_make_stat_result)
+try:
+ _copy_reg.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)
@@ -621,4 +624,8 @@ def _pickle_statvfs_result(sr):
(type, args) = sr.__reduce__()
return (_make_statvfs_result, args)
-_copy_reg.pickle(statvfs_result, _pickle_statvfs_result,_make_statvfs_result)
+try:
+ _copy_reg.pickle(statvfs_result, _pickle_statvfs_result,
+ _make_statvfs_result)
+except NameError: # stat_result may not exist
+ pass