Merge pull request #1810 from easydiffusion/beta

Beta
This commit is contained in:
cmdr2 2024-06-14 09:49:27 +05:30 committed by GitHub
commit 716f30fecb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import traceback
import shutil import shutil
from pathlib import Path from pathlib import Path
from pprint import pprint from pprint import pprint
import re
os_name = platform.system() os_name = platform.system()
@ -225,6 +226,7 @@ def install_pkg_if_necessary(pkg_name, required_version):
def version_str_to_tuple(ver_str): def version_str_to_tuple(ver_str):
ver_str = ver_str.split("+")[0] ver_str = ver_str.split("+")[0]
ver_str = re.sub("[^0-9.]", "", ver_str)
ver = ver_str.split(".") ver = ver_str.split(".")
return tuple(map(int, ver)) return tuple(map(int, ver))

View File

@ -243,7 +243,8 @@ def get_processor_name():
if platform.system() == "Windows": if platform.system() == "Windows":
return platform.processor() return platform.processor()
elif platform.system() == "Darwin": 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" command = "sysctl -n machdep.cpu.brand_string"
return subprocess.check_output(command, shell=True).decode().strip() return subprocess.check_output(command, shell=True).decode().strip()
elif platform.system() == "Linux": elif platform.system() == "Linux":