Skip to content

Commit 0b7ab2c

Browse files
committed
Do not override builtin format
1 parent 7908efd commit 0b7ab2c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

bpython/curtsiesfrontend/repl.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import unicodedata
1616
from six.moves import range
1717

18-
from pygments import format
18+
from pygments import format as pygformat
1919
from bpython._py3compat import PythonLexer
2020
from pygments.formatters import TerminalFormatter
2121

@@ -1126,7 +1126,7 @@ def push(self, line, insert_into_history=True):
11261126

11271127
if self.config.syntax:
11281128
display_line = bpythonparse(
1129-
format(self.tokenize(line), self.formatter)
1129+
pygformat(self.tokenize(line), self.formatter)
11301130
)
11311131
# self.tokenize requires that the line not be in self.buffer yet
11321132

@@ -1208,7 +1208,7 @@ def unhighlight_paren(self):
12081208
self.highlighted_paren = None
12091209
logger.debug("trying to unhighlight a paren on line %r", lineno)
12101210
logger.debug("with these tokens: %r", saved_tokens)
1211-
new = bpythonparse(format(saved_tokens, self.formatter))
1211+
new = bpythonparse(pygformat(saved_tokens, self.formatter))
12121212
self.display_buffer[lineno] = self.display_buffer[
12131213
lineno
12141214
].setslice_with_length(
@@ -1276,7 +1276,7 @@ def current_line_formatted(self):
12761276
"""The colored current line (no prompt, not wrapped)"""
12771277
if self.config.syntax:
12781278
fs = bpythonparse(
1279-
format(self.tokenize(self.current_line), self.formatter)
1279+
pygformat(self.tokenize(self.current_line), self.formatter)
12801280
)
12811281
if self.incr_search_mode:
12821282
if self.incr_search_target in self.current_line:
@@ -1766,7 +1766,7 @@ def reprint_line(self, lineno, tokens):
17661766
logger.debug("calling reprint line with %r %r", lineno, tokens)
17671767
if self.config.syntax:
17681768
self.display_buffer[lineno] = bpythonparse(
1769-
format(tokens, self.formatter)
1769+
pygformat(tokens, self.formatter)
17701770
)
17711771

17721772
def take_back_buffer_line(self):
@@ -1920,7 +1920,7 @@ def show_source(self):
19201920
self.status_bar.message("%s" % (e,))
19211921
else:
19221922
if self.config.highlight_show_source:
1923-
source = format(
1923+
source = pygformat(
19241924
PythonLexer().get_tokens(source), TerminalFormatter()
19251925
)
19261926
self.pager(source)

0 commit comments

Comments
 (0)