summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-06-06 18:14:50 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-06-06 18:14:50 (GMT)
commit33b77de106cc49f3c7e03335d4ff989fa909b9e2 (patch)
tree9548ec63c21735cfe0c19ca791947ca35624a5e7 /Lib
parenta48cb8f77dbee2942050e947bd6fa0b37f71690c (diff)
downloadcpython-33b77de106cc49f3c7e03335d4ff989fa909b9e2.zip
cpython-33b77de106cc49f3c7e03335d4ff989fa909b9e2.tar.gz
cpython-33b77de106cc49f3c7e03335d4ff989fa909b9e2.tar.bz2
Use isinstance for the type check, use booleans.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/getopt.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/getopt.py b/Lib/getopt.py
index 3e8b7c2..fb98e88 100644
--- a/Lib/getopt.py
+++ b/Lib/getopt.py
@@ -108,7 +108,7 @@ def gnu_getopt(args, shortopts, longopts = []):
opts = []
prog_args = []
- if type(longopts) == type(""):
+ if isinstance(longopts, str):
longopts = [longopts]
else:
longopts = list(longopts)
@@ -116,11 +116,11 @@ def gnu_getopt(args, shortopts, 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] == '--':