mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-07 06:32:08 +08:00
uploader: allow ctrl+c
old-commit-hash: 13ec384ea0bce744a8fffaa1d7a977b91f06cfb7
This commit is contained in:
@@ -76,7 +76,7 @@ def is_on_wifi():
|
||||
if result is None:
|
||||
return True
|
||||
return 'WIFI' in result
|
||||
except BaseException:
|
||||
except Exception:
|
||||
cloudlog.exception("is_on_wifi failed")
|
||||
return False
|
||||
|
||||
@@ -90,7 +90,7 @@ def is_on_hotspot():
|
||||
is_entune = result.startswith('10.0.2.')
|
||||
|
||||
return (is_android or is_ios or is_entune)
|
||||
except BaseException:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
class Uploader():
|
||||
@@ -177,7 +177,7 @@ class Uploader():
|
||||
else:
|
||||
with open(fn, "rb") as f:
|
||||
self.last_resp = requests.put(url, data=f, headers=headers, timeout=10)
|
||||
except BaseException as e:
|
||||
except Exception as e:
|
||||
self.last_exc = (e, traceback.format_exc())
|
||||
raise
|
||||
|
||||
@@ -187,7 +187,7 @@ class Uploader():
|
||||
|
||||
try:
|
||||
self.do_upload(key, fn)
|
||||
except BaseException:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return self.last_resp
|
||||
|
||||
Reference in New Issue
Block a user