为什么此代码失败并出现以下异常?
"""my_program - for doing awesome stuff
Usage: my_program [--foo]
Options:
--foo - this will do foo
"""
import docopt
args = docopt.docopt(doc=__doc__)
例外:
Traceback (most recent call last):
File "/tmp/post.py", line 10, in <module>
args = docopt.docopt(doc=__doc__)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 560, in docopt
pattern = parse_pattern(formal_usage(DocoptExit.usage), options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 373, in parse_pattern
result = parse_expr(tokens, options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 381, in parse_expr
seq = parse_seq(tokens, options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 396, in parse_seq
atom = parse_atom(tokens, options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 413, in parse_atom
result = pattern(*parse_expr(tokens, options))
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 381, in parse_expr
seq = parse_seq(tokens, options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 396, in parse_seq
atom = parse_atom(tokens, options)
File "/Users/rbednark/.virtualenvs/docopt-python2/lib/python3.5/site-packages/docopt.py", line 415, in parse_atom
raise tokens.error("unmatched '%s'" % token)
docopt.DocoptLanguageError: unmatched '['
docopt 版本:0.6.2
python 版本:2.7.10
,3.5.1