fix: Script bug fixes (bare except, timezone, regex, test)
- collector.py, compliance_checker.py, trends.py: bare except -> specific - db_helper.py: datetime.now() -> timezone.utc (8 occurrences) - compliance_checker.py: regex \x08 -> \b word boundary + import json - search_providers.py: minor fixes - test_new_features.py: service reachability check retry Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -749,7 +749,7 @@ class SustainabilityCollector:
|
||||
try:
|
||||
with open(main_cases_file, 'r', encoding='utf-8') as f:
|
||||
existing_cases = json.load(f)
|
||||
except:
|
||||
except Exception:
|
||||
existing_cases = []
|
||||
all_cases = existing_cases + [asdict(case) for case in self.new_cases]
|
||||
# 去重
|
||||
@@ -949,7 +949,7 @@ def main():
|
||||
|
||||
except Exception as e:
|
||||
try: logger.error(f"收集任务失败: {e}")
|
||||
except: pass
|
||||
except Exception: pass
|
||||
print(f"ERROR: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user