From: Jean-Marc Lasgouttes Date: Wed, 4 Sep 2019 14:50:07 +0000 (+0200) Subject: Reset directory after os.chdir X-Git-Tag: lyx-2.4.0dev-acb2ca7b~1542 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=726ac318959e24ddf3dc493e95850e0f06e4b7a1;p=features.git Reset directory after os.chdir Related to bug #10454 --- diff --git a/development/tools/updatelayouts.py b/development/tools/updatelayouts.py index eaef163d80..ad02f8a672 100755 --- a/development/tools/updatelayouts.py +++ b/development/tools/updatelayouts.py @@ -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