On 5/14/17, Pavol Lisy <pavol.l...@gmail.com> wrote: > On 5/14/17, Charles T. Smith <cts.private.ya...@gmail.com> wrote: >> I'm stumped by this: > >> $ PYTHONPATH= python except >> Traceback (most recent call last): >> File "except", line 7, in <module> >> except getopt.error, msg: >> AttributeError: 'module' object has no attribute 'error' >> >> >> The program is: >> >> $ cat except >> #!/usr/bin/env python >> >> import getopt >> >> try: >> opts, args = getopt.getopt (sys.argv[1:], "t:") >> except getopt.error, msg: >> raise "Usage: some other way", msg >> >> what am I doing wrong? > > Did you create getopt.py in your working directory? If so then try to > rename it. > > PL.
And remove getopt.pyc! PL. -- https://mail.python.org/mailman/listinfo/python-list