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
fe22e098
Kaydet (Commit)
fe22e098
authored
Ara 04, 2014
tarafından
Victor Stinner
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
asyncio: Initialize more Future and Task attributes in the class definition to
avoid attribute errors in destructors.
üst
bb37b4ca
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
futures.py
Lib/asyncio/futures.py
+1
-2
tasks.py
Lib/asyncio/tasks.py
+4
-3
No files found.
Lib/asyncio/futures.py
Dosyayı görüntüle @
fe22e098
...
...
@@ -135,6 +135,7 @@ class Future:
_result
=
None
_exception
=
None
_loop
=
None
_source_traceback
=
None
_blocking
=
False
# proper use of future (yield vs yield from)
...
...
@@ -155,8 +156,6 @@ class Future:
self
.
_callbacks
=
[]
if
self
.
_loop
.
get_debug
():
self
.
_source_traceback
=
traceback
.
extract_stack
(
sys
.
_getframe
(
1
))
else
:
self
.
_source_traceback
=
None
def
_format_callbacks
(
self
):
cb
=
self
.
_callbacks
...
...
Lib/asyncio/tasks.py
Dosyayı görüntüle @
fe22e098
...
...
@@ -41,6 +41,10 @@ class Task(futures.Future):
# all running event loops. {EventLoop: Task}
_current_tasks
=
{}
# If False, don't log a message if the task is destroyed whereas its
# status is still pending
_log_destroy_pending
=
True
@classmethod
def
current_task
(
cls
,
loop
=
None
):
"""Return the currently running task in an event loop or None.
...
...
@@ -73,9 +77,6 @@ class Task(futures.Future):
self
.
_must_cancel
=
False
self
.
_loop
.
call_soon
(
self
.
_step
)
self
.
__class__
.
_all_tasks
.
add
(
self
)
# If False, don't log a message if the task is destroyed whereas its
# status is still pending
self
.
_log_destroy_pending
=
True
# On Python 3.3 or older, objects with a destructor that are part of a
# reference cycle are never destroyed. That's not the case any more on
...
...
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