A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-December/018863.html below:

[Python-Dev] pychecker on 2.2 current

[Python-Dev] pychecker on 2.2 currentFred L. Drake, Jr. fdrake@acm.org
Wed, 5 Dec 2001 11:36:19 -0500
Neal Norwitz writes:
 > mimetypes.py:405: No global (sys) found
 > 
 > This is inside usage() which presumably should only be used internally.  
 > sys is imported if __name__ == '__main__'.
 > So the problem can only be triggered if usage() is called by external source.
 > 
 > Possible fixes are:
 > 	sys could be locally imported in usage()
 > 	sys could be imported at the module scope
 > 	usage could be made _usage() to denote it's private

Neal,
  I'll propose another fix, but I don't know what pychecker would
say.  ;-)  I'd like to move the definition of usage() into the if
__name__ == "__main__" block, in which case the problem goes away
since there wouldn't be a usage() unless sys has been imported.
  I'll check it in that way.  ;-)


  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation




RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4