summaryrefslogtreecommitdiffstats
path: root/Lib/getopt.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-01-01 19:35:13 (GMT)
committerGuido van Rossum <guido@python.org>1992-01-01 19:35:13 (GMT)
commitbdfcfccbe591e15221f35add01132174c9b4e669 (patch)
tree7e5f0d52b8c44e623b12e8f4b5cd645c361e5aeb /Lib/getopt.py
parent4d8e859e8f0a209a7e999ce9cc0988156c795949 (diff)
downloadcpython-bdfcfccbe591e15221f35add01132174c9b4e669.zip
cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.gz
cpython-bdfcfccbe591e15221f35add01132174c9b4e669.tar.bz2
New == syntax
Diffstat (limited to 'Lib/getopt.py')
-rw-r--r--Lib/getopt.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/getopt.py b/Lib/getopt.py
index ef72fbc..0b71d0f 100644
--- a/Lib/getopt.py
+++ b/Lib/getopt.py
@@ -22,15 +22,15 @@ error = 'getopt error'
def getopt(args, options):
list = []
- while args and args[0][0] = '-' and args[0] <> '-':
- if args[0] = '--':
+ while args and args[0][0] == '-' and args[0] <> '-':
+ if args[0] == '--':
args = args[1:]
break
optstring, args = args[0][1:], args[1:]
while optstring <> '':
opt, optstring = optstring[0], optstring[1:]
if classify(opt, options): # May raise exception as well
- if optstring = '':
+ if optstring == '':
if not args:
raise error, 'option -' + opt + ' requires argument'
optstring, args = args[0], args[1:]
@@ -42,6 +42,6 @@ def getopt(args, options):
def classify(opt, options): # Helper to check type of option
for i in range(len(options)):
- if opt = options[i] <> ':':
- return options[i+1:i+2] = ':'
+ if opt == options[i] <> ':':
+ return options[i+1:i+2] == ':'
raise error, 'option -' + opt + ' not recognized'