Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
e0d3d4ef
Kaydet (Commit)
e0d3d4ef
authored
Ara 11, 2004
tarafından
Raymond Hettinger
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
SF bug #1083202: UnboundLocalError raised by atexit module
The sys module could be called before being imported.
üst
62770af6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
atexit.py
Lib/atexit.py
+3
-3
NEWS
Misc/NEWS
+3
-0
No files found.
Lib/atexit.py
Dosyayı görüntüle @
e0d3d4ef
...
@@ -7,6 +7,8 @@ One public function, register, is defined.
...
@@ -7,6 +7,8 @@ One public function, register, is defined.
__all__
=
[
"register"
]
__all__
=
[
"register"
]
import
sys
_exithandlers
=
[]
_exithandlers
=
[]
def
_run_exitfuncs
():
def
_run_exitfuncs
():
"""run any registered exit functions
"""run any registered exit functions
...
@@ -23,7 +25,7 @@ def _run_exitfuncs():
...
@@ -23,7 +25,7 @@ def _run_exitfuncs():
except
SystemExit
:
except
SystemExit
:
exc_info
=
sys
.
exc_info
()
exc_info
=
sys
.
exc_info
()
except
:
except
:
import
sys
,
traceback
import
traceback
print
>>
sys
.
stderr
,
"Error in atexit._run_exitfuncs:"
print
>>
sys
.
stderr
,
"Error in atexit._run_exitfuncs:"
traceback
.
print_exc
()
traceback
.
print_exc
()
exc_info
=
sys
.
exc_info
()
exc_info
=
sys
.
exc_info
()
...
@@ -41,12 +43,10 @@ def register(func, *targs, **kargs):
...
@@ -41,12 +43,10 @@ def register(func, *targs, **kargs):
"""
"""
_exithandlers
.
append
((
func
,
targs
,
kargs
))
_exithandlers
.
append
((
func
,
targs
,
kargs
))
import
sys
if
hasattr
(
sys
,
"exitfunc"
):
if
hasattr
(
sys
,
"exitfunc"
):
# Assume it's another registered exit function - append it to our list
# Assume it's another registered exit function - append it to our list
register
(
sys
.
exitfunc
)
register
(
sys
.
exitfunc
)
sys
.
exitfunc
=
_run_exitfuncs
sys
.
exitfunc
=
_run_exitfuncs
del
sys
if
__name__
==
"__main__"
:
if
__name__
==
"__main__"
:
def
x1
():
def
x1
():
...
...
Misc/NEWS
Dosyayı görüntüle @
e0d3d4ef
...
@@ -15,6 +15,9 @@ Core and builtins
...
@@ -15,6 +15,9 @@ Core and builtins
Library
Library
-------
-------
- atexit.register no longer references the sys module before importing it.
(Bug #1083202).
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
- unittest.TestCase.run() and unittest.TestSuite.run() can now be successfully
extended or overridden by subclasses. Formerly, the subclassed method would
extended or overridden by subclasses. Formerly, the subclassed method would
be ignored by the rest of the module. (Bug #1078905).
be ignored by the rest of the module. (Bug #1078905).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment