mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
posix -> os
This commit is contained in:
parent
3bc034bb79
commit
25d7cafd8a
10 changed files with 35 additions and 35 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue