]> git.lyx.org Git - features.git/commitdiff
Reset directory after os.chdir
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 4 Sep 2019 14:50:07 +0000 (16:50 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 4 Sep 2019 14:51:52 +0000 (16:51 +0200)
Related to bug #10454

development/tools/updatelayouts.py

index eaef163d80aa97d75f804028b047284f7f839898..ad02f8a672d88835e821b5467b96ab982fcf60d6 100755 (executable)
@@ -25,6 +25,7 @@ def main(argv):
     dirs.append(os.path.join(toolsdir, '../../lib/layouts'))
     dirs.append(os.path.join(toolsdir, '../../lib/citeengines'))
     for directory in dirs:
+        oldcwd = os.getcwd()
         os.chdir(directory)
         for i in os.listdir("."):
             (base, ext) = os.path.splitext(i)
@@ -33,6 +34,7 @@ def main(argv):
             args = ["layout2layout", i + ".old", i]
             shutil.copy(args[2], args[1])
             layout2layout(args)
+        os.chdir(oldcwd)
 
     return 0