mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Check that 'self.formats' is good early on.
This commit is contained in:
parent
ddad73bca9
commit
6a9a545ab1
1 changed files with 8 additions and 3 deletions
|
|
@ -11,10 +11,10 @@ import fnmatch
|
||||||
from types import *
|
from types import *
|
||||||
from glob import glob
|
from glob import glob
|
||||||
from distutils.core import Command
|
from distutils.core import Command
|
||||||
from distutils.util import \
|
from distutils.util import newer, create_tree, remove_tree, native_path
|
||||||
newer, create_tree, remove_tree, make_tarball, make_zipfile, native_path
|
from distutils.archive_util import check_archive_formats
|
||||||
from distutils.text_file import TextFile
|
from distutils.text_file import TextFile
|
||||||
from distutils.errors import DistutilsExecError
|
from distutils.errors import DistutilsExecError, DistutilsOptionError
|
||||||
|
|
||||||
|
|
||||||
class sdist (Command):
|
class sdist (Command):
|
||||||
|
|
@ -81,6 +81,11 @@ class sdist (Command):
|
||||||
elif type (self.formats) is StringType:
|
elif type (self.formats) is StringType:
|
||||||
self.formats = string.split (self.formats, ',')
|
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):
|
def run (self):
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue