[Python-checkins] r72766 - in python/branches/py3k: Lib/distutils/tests/test_archive_util.py

tarek.ziade python-checkins at python.org
Mon May 18 10:22:38 CEST 2009


Author: tarek.ziade
Date: Mon May 18 10:22:38 2009
New Revision: 72766

Log:
Merged revisions 72764 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r72764 | tarek.ziade | 2009-05-18 10:20:55 +0200 (Mon, 18 May 2009) | 1 line
  
  working with relative paths to avoid tar warnings on absolute paths
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/distutils/tests/test_archive_util.py

Modified: python/branches/py3k/Lib/distutils/tests/test_archive_util.py
==============================================================================
--- python/branches/py3k/Lib/distutils/tests/test_archive_util.py	(original)
+++ python/branches/py3k/Lib/distutils/tests/test_archive_util.py	Mon May 18 10:22:38 2009
@@ -27,7 +27,14 @@
 
         tmpdir2 = self.mkdtemp()
         base_name = os.path.join(tmpdir2, 'archive')
-        make_tarball(base_name, tmpdir)
+
+        # working with relative paths to avoid tar warnings
+        old_dir = os.getcwd()
+        os.chdir(tmpdir)
+        try:
+            make_tarball(base_name, '.')
+        finally:
+            os.chdir(old_dir)
 
         # check if the compressed tarball was created
         tarball = base_name + '.tar.gz'
@@ -35,7 +42,12 @@
 
         # trying an uncompressed one
         base_name = os.path.join(tmpdir2, 'archive')
-        make_tarball(base_name, tmpdir, compress=None)
+        old_dir = os.getcwd()
+        os.chdir(tmpdir)
+        try:
+            make_tarball(base_name, '.', compress=None)
+        finally:
+            os.chdir(old_dir)
         tarball = base_name + '.tar'
         self.assert_(os.path.exists(tarball))
 


More information about the Python-checkins mailing list