summaryrefslogtreecommitdiffstats
path: root/Lib/distutils/archive_util.py
diff options
context:
space:
mode:
authorTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 13:38:27 (GMT)
committerTarek Ziadé <ziade.tarek@gmail.com>2009-10-24 13:38:27 (GMT)
commit978cca6e27ca9842853f2af972aa186038e76490 (patch)
treecf8db2f5ad37e8665a2fcd5dd93f79453b502114 /Lib/distutils/archive_util.py
parentc2e05ed8cbbe0f585068cde517623301cfc9af53 (diff)
downloadcpython-978cca6e27ca9842853f2af972aa186038e76490.zip
cpython-978cca6e27ca9842853f2af972aa186038e76490.tar.gz
cpython-978cca6e27ca9842853f2af972aa186038e76490.tar.bz2
Merged revisions 75659 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r75659 | tarek.ziade | 2009-10-24 15:29:44 +0200 (Sat, 24 Oct 2009) | 1 line #7066 - Fixed distutils.archive_util.make_archive behavior so it restores the cwd ........
Diffstat (limited to 'Lib/distutils/archive_util.py')
-rw-r--r--Lib/distutils/archive_util.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/Lib/distutils/archive_util.py b/Lib/distutils/archive_util.py
index d051f91..28e93fe 100644
--- a/Lib/distutils/archive_util.py
+++ b/Lib/distutils/archive_util.py
@@ -232,10 +232,11 @@ def make_archive(base_name, format, root_dir=None, base_dir=None, verbose=0,
kwargs['owner'] = owner
kwargs['group'] = group
- filename = func(base_name, base_dir, **kwargs)
-
- if root_dir is not None:
- log.debug("changing back to '%s'", save_cwd)
- os.chdir(save_cwd)
+ try:
+ filename = func(base_name, base_dir, **kwargs)
+ finally:
+ if root_dir is not None:
+ log.debug("changing back to '%s'", save_cwd)
+ os.chdir(save_cwd)
return filename