Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sphinx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
['git', 'rev-parse', '--short', 'HEAD'],
cwd=package_dir,
capture_output=True,
check=False,
encoding='ascii',
errors='surrogateescape',
).stdout:
Expand Down
2 changes: 1 addition & 1 deletion sphinx/environment/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def _last_modified_time(filename: str | os.PathLike[str]) -> int:
def _format_modified_time(timestamp: int) -> str:
"""Return an RFC 3339 formatted string representing the given timestamp."""
seconds, fraction = divmod(timestamp, 10**6)
return time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(seconds)) + f'.{fraction//1_000}'
return time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(seconds)) + f'.{fraction // 1_000}'


def _traverse_toctree(
Expand Down
2 changes: 1 addition & 1 deletion sphinx/testing/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ def if_graphviz_found(app: SphinxTestApp) -> None: # NoQA: PT004
graphviz_dot = getattr(app.config, 'graphviz_dot', '')
try:
if graphviz_dot:
subprocess.run([graphviz_dot, '-V'], capture_output=True) # show version
subprocess.run([graphviz_dot, '-V'], capture_output=True, check=False)
return
except OSError: # No such file or directory
pass
Expand Down
2 changes: 1 addition & 1 deletion sphinx/testing/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ def utime(self, arg: Any) -> None:
os.utime(self, arg)

def open(self, mode: str = 'r', **kwargs: Any) -> IO:
return open(self, mode, **kwargs)
return open(self, mode, **kwargs) # NoQA: SIM115

def write_text(self, text: str, encoding: str = 'utf-8', **kwargs: Any) -> None:
"""
Expand Down
2 changes: 1 addition & 1 deletion sphinx/writers/texinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ def _add_detailed_menu(name: str) -> None:
entries = self.node_menus[name]
if not entries:
return
self.body.append(f'\n{self.escape(self.node_names[name], )}\n\n')
self.body.append(f'\n{self.escape(self.node_names[name])}\n\n')
self.add_menu_entries(entries)
for subentry in entries:
_add_detailed_menu(subentry)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_ext_imgconverter.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def _if_converter_found(app):
image_converter = getattr(app.config, 'image_converter', '')
try:
if image_converter:
subprocess.run([image_converter, '-version'], capture_output=True) # show version
subprocess.run([image_converter, '-version'], capture_output=True, check=False)
return
except OSError: # No such file or directory
pass
Expand Down
1 change: 0 additions & 1 deletion tests/test_pycode_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
("a % b", "a % b"), # Mod
("a * b", "a * b"), # Mult
("sys", "sys"), # Name, NameConstant
("1234", "1234"), # Num
("not a", "not a"), # Not
("a or b", "a or b"), # Or
("a**b", "a**b"), # Pow
Expand Down