Ultralytics Code Refactor https://ultralytics.com/actions (#16940)
Co-authored-by: Glenn Jocher <glenn.jocher@ultralytics.com>
This commit is contained in:
parent
0027e0837c
commit
a622b404ef
19 changed files with 32 additions and 33 deletions
|
|
@ -526,7 +526,7 @@ def read_device_model() -> str:
|
|||
try:
|
||||
with open("/proc/device-tree/model") as f:
|
||||
return f.read()
|
||||
except: # noqa E722
|
||||
except Exception:
|
||||
return ""
|
||||
|
||||
|
||||
|
|
@ -584,7 +584,7 @@ def is_docker() -> bool:
|
|||
try:
|
||||
with open("/proc/self/cgroup") as f:
|
||||
return "docker" in f.read()
|
||||
except: # noqa E722
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
|
|
@ -623,7 +623,7 @@ def is_online() -> bool:
|
|||
for dns in ("1.1.1.1", "8.8.8.8"): # check Cloudflare and Google DNS
|
||||
socket.create_connection(address=(dns, 80), timeout=2.0).close()
|
||||
return True
|
||||
except: # noqa E722
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue