summaryrefslogtreecommitdiffstats
path: root/Lib/plat-mac/macfs.py
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2003-01-22 14:04:18 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2003-01-22 14:04:18 (GMT)
commit32417e7dc1cfbcf52b6034cced6e0e902dbc3ccb (patch)
treed017c7ade0964488b4de467a6f78821377212dc9 /Lib/plat-mac/macfs.py
parentd44a3ec63c5d3608c3dc88fbc5f63dd6a96303d6 (diff)
downloadcpython-32417e7dc1cfbcf52b6034cced6e0e902dbc3ccb.zip
cpython-32417e7dc1cfbcf52b6034cced6e0e902dbc3ccb.tar.gz
cpython-32417e7dc1cfbcf52b6034cced6e0e902dbc3ccb.tar.bz2
Tweaked time conversion to work in MacPython-OS9.
Diffstat (limited to 'Lib/plat-mac/macfs.py')
-rw-r--r--Lib/plat-mac/macfs.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/Lib/plat-mac/macfs.py b/Lib/plat-mac/macfs.py
index 5866732..1a8a4f8 100644
--- a/Lib/plat-mac/macfs.py
+++ b/Lib/plat-mac/macfs.py
@@ -31,13 +31,16 @@ if time.gmtime(0)[0] == 1970:
t = utc[1] + _EPOCHCONVERT
return int(t)
def _time2utc(t):
- t = t - _EPOCHCONVERT
+ t = int(t) - _EPOCHCONVERT
if t < -0x7fffffff:
t = t + 0x10000000L
return (0, int(t), 0)
else:
def _utc2time(utc): return utc[1]
- def _time2utc(t): return (0, t, 0)
+ def _time2utc(t):
+ if t > 0x7fffffff:
+ t = t - 0x100000000L
+ return (0, int(t), 0)
# The old name of the error object:
error = Carbon.File.Error