Skip to content

Commit cf422ac

Browse files
Move 'black' import inline.
1 parent 4a74eb5 commit cf422ac

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ptpython/repl.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
from enum import Enum
2020
from typing import Any, Callable, ContextManager, Dict, Optional
2121

22-
import black
2322
from prompt_toolkit.formatted_text import (
2423
HTML,
2524
AnyFormattedText,
@@ -264,6 +263,9 @@ def show_result(self, result: object) -> None:
264263
else:
265264
# Syntactically correct. Format with black and syntax highlight.
266265
if self.enable_output_formatting:
266+
# Inline import. Slightly speed up start-up time if black is
267+
# not used.
268+
import black
267269
result_repr = black.format_str(
268270
result_repr,
269271
mode=black.FileMode(line_length=self.app.output.get_size().columns),

0 commit comments

Comments
 (0)