help with an error msg please

Charles T. Smith cts.private.yahoo at gmail.com
Sun May 14 09:01:49 EDT 2017


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?



More information about the Python-list mailing list