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 5cc65f4 commit c1068e3Copy full SHA for c1068e3
fibers/_pyfibers.py
@@ -12,8 +12,10 @@ def current():
12
try:
13
return _tls.current_fiber
14
except AttributeError:
15
- _create_main_fiber()
16
- return _tls.current_fiber
+ fiber = _create_main_fiber()
+ _tls.current_fiber = fiber
17
+ _tls.main_fiber = fiber
18
+ return fiber
19
20
21
class error(Exception):
@@ -121,6 +123,4 @@ def _create_main_fiber():
121
123
main_fiber._is_started = True
122
124
main_fiber._thread_id = threading.current_thread().ident
125
main_fiber.__dict__['parent'] = None
- _tls.main_fiber = main_fiber
- _tls.current_fiber = main_fiber
126
-
+ return main_fiber
0 commit comments