Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __parse_task(self, task):
""" Returns a task as an RSATask object
>>> o = Oracle()
>>> def callback(*args):
... return True
>>> inq, outq = mp.Queue(), mp.Queue()
>>> worker = RSAOracleWorker(o, callback, inq, outq, 123456, 0x10001)
>>> worker._RSAOracleWorker__parse_task((1,2,3,4,5)) == None
True
>>> worker._RSAOracleWorker__parse_task((1,2,3,4)) # doctest: +ELLIPSIS
<....RSATask object ...
>>> inq.close()
>>> outq.close()
"""
try:
new_task = RSAOracleWorker.RSATask(task)
except ValueError:
new_task = None
return new_task