summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGreg Ward <gward@python.net>2000-04-22 03:11:55 (GMT)
committerGreg Ward <gward@python.net>2000-04-22 03:11:55 (GMT)
commit6a9a545ab11694411947ae52aad2502e9094c710 (patch)
tree0f45334b11dfe382fd151fa63160531b3f612767 /Lib
parentddad73bca9072b3d4228c3d12965dbae72db2b46 (diff)
downloadcpython-6a9a545ab11694411947ae52aad2502e9094c710.zip
cpython-6a9a545ab11694411947ae52aad2502e9094c710.tar.gz
cpython-6a9a545ab11694411947ae52aad2502e9094c710.tar.bz2
Check that 'self.formats' is good early on.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/distutils/command/sdist.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/distutils/command/sdist.py b/Lib/distutils/command/sdist.py
index 2cf8e38..8aa4618 100644
--- a/Lib/distutils/command/sdist.py
+++ b/Lib/distutils/command/sdist.py
@@ -11,10 +11,10 @@ import fnmatch
from types import *
from glob import glob
from distutils.core import Command
-from distutils.util import \
- newer, create_tree, remove_tree, make_tarball, make_zipfile, native_path
+from distutils.util import newer, create_tree, remove_tree, native_path
+from distutils.archive_util import check_archive_formats
from distutils.text_file import TextFile
-from distutils.errors import DistutilsExecError
+from distutils.errors import DistutilsExecError, DistutilsOptionError
class sdist (Command):
@@ -81,6 +81,11 @@ class sdist (Command):
elif type (self.formats) is StringType:
self.formats = string.split (self.formats, ',')
+ bad_format = check_archive_formats (self.formats)
+ if bad_format:
+ raise DistutilsOptionError, \
+ "unknown archive format '%s'" % bad_format
+
def run (self):