Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
0081cc52
Commit
0081cc52
authored
Aug 14, 1999
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better detection of bad entries in option table.
Better error messages for bad entries in option table.
parent
8c66b697
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
Lib/distutils/fancy_getopt.py
Lib/distutils/fancy_getopt.py
+11
-3
No files found.
Lib/distutils/fancy_getopt.py
View file @
0081cc52
...
...
@@ -47,16 +47,24 @@ def fancy_getopt (options, object, args):
attr_name
=
{}
takes_arg
=
{}
for
(
long
,
short
,
help
)
in
options
:
for
option
in
options
:
try
:
(
long
,
short
,
help
)
=
option
except
ValueError
:
raise
DistutilsGetoptError
,
\
"invalid option tuple "
+
str
(
option
)
# Type-check the option names
if
type
(
long
)
is
not
StringType
or
len
(
long
)
<
2
:
raise
DistutilsGetoptError
,
\
"long option must be a string of length >= 2"
"long option '%s' must be a string of length >= 2"
%
\
long
if
(
not
((
short
is
None
)
or
(
type
(
short
)
is
StringType
and
len
(
short
)
==
1
))):
raise
DistutilsGetoptError
,
\
"short option must be None or string of length 1"
"short option '%s' must be None or string of length 1"
%
\
short
long_opts
.
append
(
long
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment