Skip to content

Commit

Permalink
theme comparison: Print nice error message if GitPython is not found
Browse files Browse the repository at this point in the history
  • Loading branch information
mgeier committed May 12, 2021
1 parent e09bd1f commit be6a081
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion theme_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import argparse
from pathlib import Path

import git
from sphinx.cmd.build import build_main


Expand All @@ -36,6 +35,13 @@
help='theme names (according to "*-theme" branch names)')
args = parser.parse_args()

try:
import git
except ImportError as e:
parser.exit(
'The Python package GitPython has to be installed:\n\n'
' python3 -m pip install GitPython\n')

main_dir = Path(__file__).resolve().parent / 'theme_comparison'
main_dir.mkdir(exist_ok=True)
repo = git.Repo(main_dir, search_parent_directories=True)
Expand Down

0 comments on commit be6a081

Please sign in to comment.