diff options
author | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-29 23:49:17 +0000 |
---|---|---|
committer | Tarek Ziadé <ziade.tarek@gmail.com> | 2009-01-29 23:49:17 +0000 |
commit | 5da9a51d9d18082665f69351817fcf36e250e835 (patch) | |
tree | 72361f5f170ae8fde1f6696fc4186f56fea6cb16 | |
parent | 707c593761930016d00e7dbeb828e6f8c973622d (diff) | |
download | cpython-git-5da9a51d9d18082665f69351817fcf36e250e835.tar.gz |
fixed test_make_distribution so it runs on any platform, as long as tar an gzip are available
-rw-r--r-- | Lib/distutils/tests/test_sdist.py | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/Lib/distutils/tests/test_sdist.py b/Lib/distutils/tests/test_sdist.py index 96ec381ec6..0d839b5c6e 100644 --- a/Lib/distutils/tests/test_sdist.py +++ b/Lib/distutils/tests/test_sdist.py @@ -10,7 +10,7 @@ from distutils.command.sdist import sdist from distutils.core import Distribution from distutils.tests.test_config import PyPIRCCommandTestCase from distutils.errors import DistutilsExecError -from distutils.spawn import spawn +from distutils.spawn import find_executable CURDIR = os.path.dirname(__file__) TEMP_PKG = join(CURDIR, 'temppkg') @@ -111,15 +111,12 @@ class sdistTestCase(PyPIRCCommandTestCase): def test_make_distribution(self): - self._init_tmp_pkg() + # check if tar and gzip are installed + if (find_executable('tar') is None or + find_executable('gzip') is None): + return - # check if tar is installed under win32 - if sys.platform == 'win32': - try: - spawn('tar --help') - except DistutilsExecError: - # let's return, no need to go further - return + self._init_tmp_pkg() # now building a sdist dist = Distribution() |