mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-21 15:53:17 +01:00
commit
716f30fecb
@ -15,6 +15,7 @@ import traceback
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
from pprint import pprint
|
||||
import re
|
||||
|
||||
os_name = platform.system()
|
||||
|
||||
@ -225,6 +226,7 @@ def install_pkg_if_necessary(pkg_name, required_version):
|
||||
|
||||
def version_str_to_tuple(ver_str):
|
||||
ver_str = ver_str.split("+")[0]
|
||||
ver_str = re.sub("[^0-9.]", "", ver_str)
|
||||
ver = ver_str.split(".")
|
||||
return tuple(map(int, ver))
|
||||
|
||||
|
@ -243,7 +243,8 @@ def get_processor_name():
|
||||
if platform.system() == "Windows":
|
||||
return platform.processor()
|
||||
elif platform.system() == "Darwin":
|
||||
os.environ["PATH"] = os.environ["PATH"] + os.pathsep + "/usr/sbin"
|
||||
if "/usr/sbin" not in os.environ["PATH"].split(os.pathsep):
|
||||
os.environ["PATH"] = os.environ["PATH"] + os.pathsep + "/usr/sbin"
|
||||
command = "sysctl -n machdep.cpu.brand_string"
|
||||
return subprocess.check_output(command, shell=True).decode().strip()
|
||||
elif platform.system() == "Linux":
|
||||
|
Loading…
Reference in New Issue
Block a user