Skip to content

Commit

Permalink
Backport PR #8985: override vformat instead of _vformat
Browse files Browse the repository at this point in the history
in our eval formatters

avoids being caught out by changes in private API

this needs to be backported in order to support Python 3.4.4
...
  • Loading branch information
minrk committed Nov 24, 2015
1 parent 47f3bb4 commit 1caeeca
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions IPython/utils/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,7 @@ class FullEvalFormatter(Formatter):
"""
# copied from Formatter._vformat with minor changes to allow eval
# and replace the format_spec code with slicing
def _vformat(self, format_string, args, kwargs, used_args, recursion_depth):
if recursion_depth < 0:
raise ValueError('Max string recursion exceeded')
def vformat(self, format_string, args, kwargs):
result = []
for literal_text, field_name, format_spec, conversion in \
self.parse(format_string):
Expand Down

0 comments on commit 1caeeca

Please sign in to comment.