Skip to content

Commit 94e323a

Browse files
committed
fixed possible crash when metadata not installed
1 parent 27e834a commit 94e323a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/gitfetch/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def _get_version() -> str:
1212
# Try to get version from package metadata
1313
from importlib import metadata
1414
return metadata.version("gitfetch")
15-
except (ImportError, metadata.PackageNotFoundError):
15+
except (ImportError):
1616
pass
1717

1818
# Fallback: try to read from pyproject.toml (works in development)

src/gitfetch/config.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def _load_config(self) -> None:
7676
# Create default config
7777
self.config['DEFAULT'] = {
7878
'username': '',
79-
'cache_expiry_minutes': '15'
79+
'cache_expiry_minutes': '15',
80+
'api_key': '',
8081
}
8182
self.config.add_section('COLORS')
8283
for key, value in default_colors.items():

0 commit comments

Comments
 (0)