Author: danielsh Date: Mon Jul 2 19:56:09 2018 New Revision: 1834878 URL: http://svn.apache.org/viewvc?rev=1834878&view=rev Log: * tools/dist/backport_tests.py (chdir): Add a docstring emphasising that this isn't fchdir(). Not driven so much by needs of this file as by the likelihood that someone (possibly future me) will crib this function for use elsewhere.
Modified: subversion/trunk/tools/dist/backport_tests.py Modified: subversion/trunk/tools/dist/backport_tests.py URL: http://svn.apache.org/viewvc/subversion/trunk/tools/dist/backport_tests.py?rev=1834878&r1=1834877&r2=1834878&view=diff ============================================================================== --- subversion/trunk/tools/dist/backport_tests.py (original) +++ subversion/trunk/tools/dist/backport_tests.py Mon Jul 2 19:56:09 2018 @@ -53,6 +53,12 @@ import sys @contextlib.contextmanager def chdir(dir): + """This is a context manager that saves the current working directory's + pathname. Upon entry it chdir's to the argument DIR; upon exit it chdir's + back to the saved pathname. + + The current working directory is restored using os.chdir(), not os.fchdir(). + """ try: saved_dir = os.getcwd() os.chdir(dir)