Docker-python fix for get_ubuntu_version() (#4430)
This commit is contained in:
parent
9d27e7ada4
commit
162e4035eb
4 changed files with 9 additions and 8 deletions
|
|
@ -571,9 +571,10 @@ def get_ubuntu_version():
|
|||
Returns:
|
||||
(str): Ubuntu version or None if not an Ubuntu OS.
|
||||
"""
|
||||
with contextlib.suppress(FileNotFoundError, AttributeError):
|
||||
with open('/etc/os-release') as f:
|
||||
return re.search(r'VERSION_ID="(\d+\.\d+)"', f.read())[1]
|
||||
if is_ubuntu():
|
||||
with contextlib.suppress(FileNotFoundError, AttributeError):
|
||||
with open('/etc/os-release') as f:
|
||||
return re.search(r'VERSION_ID="(\d+\.\d+)"', f.read())[1]
|
||||
|
||||
|
||||
def get_user_config_dir(sub_dir='Ultralytics'):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue