Skip to content

Commit 42475df

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d443039 commit 42475df

1 file changed

Lines changed: 6 additions & 13 deletions

File tree

sphinx_gitstamp/__init__.py

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,8 @@ def page_context_handler(app, pagename, templatename, context, doctree):
6262
raise errors.ExtensionError("Can't fetch git history for %s." % file_path)
6363
except ValueError:
6464
# Datestamp can't be parsed.
65-
app.info(
66-
"%s: Can't parse datestamp () %s ) for gitstamp, output \
67-
won't have last updated time."
68-
% (pagename, updated)
69-
)
65+
app.info("%s: Can't parse datestamp () %s ) for gitstamp, output \
66+
won't have last updated time." % (pagename, updated))
7067
pass
7168

7269

@@ -79,23 +76,19 @@ def what_build_am_i(app):
7976
try:
8077
import git
8178
except ImportError as e:
82-
raise errors.ExtensionError(
83-
f"""Unable to import gitpython. \
79+
raise errors.ExtensionError(f"""Unable to import gitpython. \
8480
Required to generate html. You may need to run: pip install gitpython.
8581
8682
The error was: {e}
87-
"""
88-
)
83+
""")
8984

9085
try:
9186
global g
9287
g = git.Git(".")
9388
except BaseException:
9489
app.info(sys.exc_info()[0])
95-
app.warn(
96-
"gitstamp extension enabled, but no git repository found. No \
97-
git datestamps will be generated."
98-
)
90+
app.warn("gitstamp extension enabled, but no git repository found. No \
91+
git datestamps will be generated.")
9992
else:
10093
app.connect("html-page-context", page_context_handler)
10194

0 commit comments

Comments
 (0)