From: Michael W. Hudson Date: Sat, 16 Mar 2002 18:02:20 +0000 (+0000) Subject: backport my checkin of X-Git-Tag: v2.2.1c1~32 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=09a5bd8c48c7bbb2f5c1f0217a6ef6ce289d1565;p=thirdparty%2FPython%2Fcpython.git backport my checkin of revision 1.54 of os.py Fix [ 530236 ] os.py assumes existence of statvfs_resul This was pretty dense of me. Sorry. 2.2.1 candidate. --- diff --git a/Lib/os.py b/Lib/os.py index 6ffd9cb787f6..2a5210fc8c1e 100644 --- a/Lib/os.py +++ b/Lib/os.py @@ -601,7 +601,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) @@ -610,4 +613,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: # statvfs_result may not exist + pass