We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5c9ad62 commit c6c1bbdCopy full SHA for c6c1bbd
Lib/_pyio.py
@@ -2581,11 +2581,11 @@ def detach(self):
2581
2582
import atexit, weakref
2583
2584
-_all_writers = weakref.WeakKeyDictionary()
+_all_writers = weakref.WeakSet()
2585
2586
def _register_writer(w):
2587
# keep weak-ref to buffered writer
2588
- _all_writers[w] = True
+ _all_writers.add(w)
2589
2590
def _flush_all_writers():
2591
# Ensure all buffered writers are flushed before proceeding with
0 commit comments