From fb4ec11231368bb8894abeeb1eb365879557b658 Mon Sep 17 00:00:00 2001 From: loonghao Date: Sun, 7 Jul 2024 14:54:38 +0800 Subject: [PATCH] fix: fix get `APPDATA` path error from Linux. --- README.md | 2 +- maya_umbrella/vaccines/vaccine3.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 78bad8d..9ce4a54 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,7 @@ pip install -r requirements-dev.txt ## 在maya中测试 With `nox -s maya -- `, start maya. -Nox will dynamically register a nox session based on your local installation of maya, +Nox will dynamically register a nox session based on your local installation of maya, e.g. if you have `maya-2020` installed locally, then you can start maya with a test environment. Then you can start maya with a test environment via diff --git a/maya_umbrella/vaccines/vaccine3.py b/maya_umbrella/vaccines/vaccine3.py index 25e2515..2057577 100644 --- a/maya_umbrella/vaccines/vaccine3.py +++ b/maya_umbrella/vaccines/vaccine3.py @@ -1,6 +1,7 @@ # Import built-in modules import glob import os +import platform # Import local modules from maya_umbrella.filesystem import check_virus_by_signature @@ -81,7 +82,8 @@ def collect_infected_hik_files(self): def collect_issues(self): """Collect all issues related to the virus.""" - self.api.add_malicious_file(os.path.join(os.getenv("APPDATA"), "syssst")) + if platform.system() == "Windows": + self.api.add_malicious_file(os.path.join(os.getenv("APPDATA"), "syssst")) self.collect_infected_mel_files() self.collect_infected_hik_files() self.collect_infected_nodes()