Merge pull request #27 from Erethon/fix-timeout

Fix type bug when specifying --timeout
This commit is contained in:
acehoss 2023-10-27 17:08:11 -05:00 committed by GitHub
commit 94b8d8ed66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,7 +105,14 @@ class Args:
self.program_args = args.get("<arg>", None) or []
self.no_id = args.get("--no-id", None) or False
self.mirror = args.get("--mirror", None) or False
self.timeout = args.get("--timeout", None) or RNS.Transport.PATH_REQUEST_TIMEOUT
timeout = args.get("--timeout", None)
self.timeout = None
try:
if timeout:
self.timeout = int(timeout)
except ValueError:
print("Invalid value for --timeout")
sys.exit(1)
self.destination = args.get("<destination_hash>", None)
self.help = args.get("--help", None) or False
self.command_line = [self.program] if self.program else []