Permalink
Browse files

When moving old config files, don't clobber files we've previously mo…

…ved.
  • Loading branch information...
1 parent 75bb82b commit 183111be6505ba0a702db448b05a1a5fd0538c9c @takluyver committed Jul 4, 2011
Showing with 4 additions and 0 deletions.
  1. +4 −0 IPython/utils/path.py
View
@@ -435,6 +435,10 @@ def check_for_old_config(ipython_dir=None):
os.unlink(f)
else:
oldf = f+'.old'
+ i = 0
+ while os.path.exists(oldf):
+ oldf = f+'.old.%i'%i
+ i += 1
os.rename(f, oldf)
warn.warn("Renamed old IPython config file '%s' to '%s'." % (f, oldf))
warned = True

0 comments on commit 183111b

Please sign in to comment.