refactor: Remove unused imports and add exception comments
Co-authored-by: jmiller-moko <230051081+jmiller-moko@users.noreply.github.com>
This commit is contained in:
@@ -31,14 +31,13 @@ Exit codes:
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
import os
|
||||
import pickle
|
||||
import sys
|
||||
import xml.etree.ElementTree as ET
|
||||
from dataclasses import dataclass, asdict
|
||||
from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from pathlib import Path
|
||||
from typing import Dict, List, Optional, Tuple
|
||||
from typing import Dict, List, Optional
|
||||
|
||||
|
||||
# Version
|
||||
@@ -146,6 +145,7 @@ class DetectionCache:
|
||||
with open(cache_file, 'wb') as f:
|
||||
pickle.dump(result, f)
|
||||
except (pickle.PickleError, OSError):
|
||||
# Ignore cache write failures: cache is optional optimization
|
||||
pass
|
||||
|
||||
def clear(self) -> None:
|
||||
@@ -154,6 +154,7 @@ class DetectionCache:
|
||||
try:
|
||||
cache_file.unlink()
|
||||
except OSError:
|
||||
# Ignore failures to delete cache files: stale cache entries are non-critical
|
||||
pass
|
||||
|
||||
|
||||
@@ -228,7 +229,6 @@ class PlatformDetector:
|
||||
indicators: List[str] = []
|
||||
metadata: Dict[str, str] = {}
|
||||
|
||||
manifest_patterns = ["**/*.xml"]
|
||||
skip_dirs = {".git", "vendor", "node_modules", ".github"}
|
||||
|
||||
for xml_file in self.repo_path.glob("**/*.xml"):
|
||||
|
||||
Reference in New Issue
Block a user