File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Filter options
Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Original file line number Diff line number Diff line change @@ -113,29 +113,24 @@ def get(self, block=True, timeout=None):
113
113
if self ._shutdown_state .value == _queue_shutdown_immediate :
114
114
raise ShutDown
115
115
if block and timeout is None :
116
+ if self ._shutdown_state .value == _queue_shutdown and self .empty ():
117
+ raise ShutDown
116
118
with self ._rlock :
117
- if self ._shutdown_state .value == _queue_shutdown_immediate or \
118
- (self ._shutdown_state .value == _queue_shutdown and self .empty ()):
119
- raise ShutDown
120
119
res = self ._recv_bytes ()
121
120
self ._sem .release ()
122
121
else :
123
122
if block :
124
123
deadline = time .monotonic () + timeout
124
+ if self ._shutdown_state .value == _queue_shutdown and self .empty ():
125
+ raise ShutDown
125
126
if not self ._rlock .acquire (block , timeout ):
126
- if self ._shutdown_state .value == _queue_shutdown :
127
- raise ShutDown
128
127
raise Empty
129
128
try :
130
129
if block :
131
130
timeout = deadline - time .monotonic ()
132
131
if not self ._poll (timeout ):
133
- if self ._shutdown_state .value == _queue_shutdown :
134
- raise ShutDown
135
132
raise Empty
136
133
elif not self ._poll ():
137
- if self ._shutdown_state .value == _queue_shutdown :
138
- raise ShutDown
139
134
raise Empty
140
135
res = self ._recv_bytes ()
141
136
self ._sem .release ()
You can’t perform that action at this time.
0 commit comments