Skip to content

Commit

Permalink
Use isinstance for the type check, use booleans.
Browse files Browse the repository at this point in the history
  • Loading branch information
loewis committed Jun 6, 2002
1 parent a48cb8f commit 33b77de
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Lib/getopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,19 @@ def gnu_getopt(args, shortopts, longopts = []):

opts = []
prog_args = []
if type(longopts) == type(""):
if isinstance(longopts, str):
longopts = [longopts]
else:
longopts = list(longopts)

# Allow options after non-option arguments?
if shortopts.startswith('+'):
shortopts = shortopts[1:]
all_options_first = 1
all_options_first = True
elif os.getenv("POSIXLY_CORRECT"):
all_options_first = 1
all_options_first = True
else:
all_options_first = 0
all_options_first = False

while args:
if args[0] == '--':
Expand Down

0 comments on commit 33b77de

Please sign in to comment.