This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: UnboundLocalError raised by atexit module
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: loechelt, rhettinger
Priority: normal Keywords:

Created on 2004-12-10 21:39 by loechelt, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
atexit.py loechelt, 2004-12-10 21:41 atexit.py file with patch for missing import statement
atexit.py loechelt, 2004-12-10 23:45 atexit.py file with patch for missing import statement
Messages (2)
msg23645 - (view) Author: Gary H. Loechelt (loechelt) Date: 2004-12-10 21:39
The following exception is raised on exit by Python 2.4
under certain circumstances:

Error in sys.exitfunc:
Traceback (most recent call last):
  File
"/usr/local/python/python2.4/lib/python2.4/atexit.py",
line 24, in _run_exitfuncs
    exc_info = sys.exc_info()
UnboundLocalError: local variable 'sys' referenced
before assignment

I traced the problem to a missing import statement in
the atexit.py file.  I am enclosing a corrected file
with the patch.

Gary H. Loechelt
msg23646 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2004-12-11 02:54
Logged In: YES 
user_id=80475

Fixed.
See Lib/atexit.py 1.9 and 1.8.2.1.
Thanks for the bug report.
History
Date User Action Args
2022-04-11 14:56:08adminsetgithub: 41308
2004-12-10 21:39:35loecheltcreate