Make the global "actions" variable a local inside parse_opts() since the
authorZac Medico <zmedico@gentoo.org>
Tue, 23 Jun 2009 19:10:12 +0000 (19:10 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 23 Jun 2009 19:10:12 +0000 (19:10 -0000)
name collision with the _emerge.actions module triggers this traceback with
epydoc-3.0.1:

Traceback (most recent call last):
  File "/usr/bin/epydoc", line 13, in <module>
    cli()
  File "/usr/lib/python2.6/site-packages/epydoc/cli.py", line 965, in cli
    main(options, names)
  File "/usr/lib/python2.6/site-packages/epydoc/cli.py", line 757, in main
    exclude_parse=exclude_parse)
  File "/usr/lib/python2.6/site-packages/epydoc/docbuilder.py", line 235, in build_doc_index
    docindex = DocIndex(docs)
  File "/usr/lib/python2.6/site-packages/epydoc/apidoc.py", line 1715, in __init__
    raise ValueError("All APIdocs passed to DocIndexer "
ValueError: All APIdocs passed to DocIndexer must already have canonical names.

svn path=/main/trunk/; revision=13674

pym/_emerge/__init__.py

index 622c1c6e1185201f18a1290ee73cd5a972b190e0..80b08bcc9b1546b9f35fccdb9b78f44a7190708b 100644 (file)
@@ -45,13 +45,6 @@ from _emerge._flush_elog_mod_echo import _flush_elog_mod_echo
 from _emerge.is_valid_package_atom import is_valid_package_atom
 from _emerge.stdout_spinner import stdout_spinner
 
-
-actions = frozenset([
-"clean", "config", "depclean",
-"info", "list-sets", "metadata",
-"prune", "regen",  "search",
-"sync",  "unmerge", "version",
-])
 options=[
 "--ask",          "--alphabetical",
 "--buildpkg",     "--buildpkgonly",
@@ -443,7 +436,14 @@ def parse_opts(tmpcmdline, silent=False):
        myopts = {}
        myfiles=[]
 
-       global actions, options, shortmapping
+       global options, shortmapping
+
+       actions = frozenset([
+               "clean", "config", "depclean",
+               "info", "list-sets", "metadata",
+               "prune", "regen",  "search",
+               "sync",  "unmerge", "version",
+       ])
 
        longopt_aliases = {"--cols":"--columns", "--skip-first":"--skipfirst"}
        argument_options = {