posix -> os

This commit is contained in:
Guido van Rossum 1992-03-31 19:04:48 +00:00
parent 3bc034bb79
commit 25d7cafd8a
10 changed files with 35 additions and 35 deletions

View file

@ -32,16 +32,16 @@ defaultfile = 'wsrestore.py'
def save():
import __main__
import posix
import os
# XXX On SYSV, if len(defaultfile) >= 14, this is wrong!
backup = defaultfile + '~'
try:
posix.unlink(backup)
except posix.error:
os.unlink(backup)
except os.error:
pass
try:
posix.rename(defaultfile, backup)
except posix.error:
os.rename(defaultfile, backup)
except os.error:
pass
fp = open(defaultfile, 'w')
writedict(__main__.__dict__, fp)