MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / make_backup

Function make_backup

tools/python-3.11.9-amd64/Tools/scripts/pindent.py:373–387  ·  view source on GitHub ↗
(filename)

Source from the content-addressed store, hash-verified

371# end def reformat_string
372
373def make_backup(filename):
374 import os, os.path
375 backup = filename + '~'
376 if os.path.lexists(backup):
377 try:
378 os.remove(backup)
379 except OSError:
380 print("Can't remove backup %r" % (backup,), file=sys.stderr)
381 # end try
382 # end if
383 try:
384 os.rename(filename, backup)
385 except OSError:
386 print("Can't rename %r to %r" % (filename, backup), file=sys.stderr)
387 # end try
388# end def make_backup
389
390def complete_file(filename, stepsize = STEPSIZE, tabsize = TABSIZE, expandtabs = EXPANDTABS):

Callers 3

complete_fileFunction · 0.85
delete_fileFunction · 0.85
reformat_fileFunction · 0.85

Calls 3

printFunction · 0.50
removeMethod · 0.45
renameMethod · 0.45

Tested by

no test coverage detected