if self._imp is not None:
self._imp.cancel()
+ def _poll(self):
+ if self._imp is not None:
+ return self._imp.poll()
+ return self.returncode
+
def _wait(self):
if self.returncode is not None:
return self.returncode
if self._proc is not None:
self._proc.cancel()
+ def _poll(self):
+ if self._proc is not None:
+ return self._proc.poll()
+ return self.returncode
+
def _wait(self):
if self.returncode is not None:
return self.returncode
_force_async=True, _force_process=True)
lock2.start()
# lock2 should we waiting for lock1 to release
+ self.assertEqual(lock2.poll(), None)
self.assertEqual(lock2.returncode, None)
lock1.unlock()
_force_async=True, _force_process=True)
lock2.start()
# lock2 should we waiting for lock1 to release
+ self.assertEqual(lock2.poll(), None)
self.assertEqual(lock2.returncode, None)
# Cancel lock2 and then check wait() and returncode results.