File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Filter options
Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
Original file line number Diff line number Diff line change @@ -647,13 +647,14 @@ def matplotlib_fname():
647
647
648
648
oldname = os .path .join (os .getcwd (), '.matplotlibrc' )
649
649
if os .path .exists (oldname ):
650
- warnings .warn ("""\
651
- Old rc filename ".matplotlibrc" found in working dir and and renamed to new
652
- default rc file name "matplotlibrc" (no leading ".").""" )
653
650
try :
654
651
shutil .move ('.matplotlibrc' , 'matplotlibrc' )
655
652
except IOError as e :
656
653
warnings .warn ('File could not be renamed: %s' % e )
654
+ else :
655
+ warnings .warn ("""\
656
+ Old rc filename ".matplotlibrc" found in working dir and and renamed to new
657
+ default rc file name "matplotlibrc" (no leading ".").""" )
657
658
658
659
home = get_home ()
659
660
configdir = get_configdir ()
@@ -662,14 +663,15 @@ def matplotlib_fname():
662
663
if os .path .exists (oldname ):
663
664
if configdir is not None :
664
665
newname = os .path .join (configdir , 'matplotlibrc' )
665
- warnings .warn ("""\
666
- Old rc filename "%s" found and renamed to new default rc file name "%s"."""
667
- % (oldname , newname ))
668
666
669
667
try :
670
668
shutil .move (oldname , newname )
671
669
except IOError as e :
672
670
warnings .warn ('File could not be renamed: %s' % e )
671
+ else :
672
+ warnings .warn ("""\
673
+ Old rc filename "%s" found and renamed to new default rc file name "%s"."""
674
+ % (oldname , newname ))
673
675
else :
674
676
warnings .warn ("""\
675
677
Could not rename old rc file "%s": a suitable configuration directory could not
Original file line number Diff line number Diff line change @@ -104,13 +104,14 @@ class TexManager:
104
104
105
105
if os .path .exists (oldcache ):
106
106
if texcache is not None :
107
- warnings .warn ("""\
108
- Found a TeX cache dir in the deprecated location "%s".
109
- Moving it to the new default location "%s".""" % (oldcache , texcache ))
110
107
try :
111
108
shutil .move (oldcache , texcache )
112
109
except IOError as e :
113
110
warnings .warn ('File could not be renamed: %s' % e )
111
+ else :
112
+ warnings .warn ("""\
113
+ Found a TeX cache dir in the deprecated location "%s".
114
+ Moving it to the new default location "%s".""" % (oldcache , texcache ))
114
115
else :
115
116
warnings .warn ("""\
116
117
Could not rename old TeX cache dir "%s": a suitable configuration
You can’t perform that action at this time.
0 commit comments