Skip to content

Commit

Permalink
autoreformat with darker
Browse files Browse the repository at this point in the history
  • Loading branch information
Carreau committed Oct 13, 2020
1 parent 415c367 commit 7eb668f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions IPython/core/magics/execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ def __str__(self):
pm = "+-"
if hasattr(sys.stdout, "encoding") and sys.stdout.encoding:
try:
u"\xb1".encode(sys.stdout.encoding)
pm = u"\xb1"
"\xb1".encode(sys.stdout.encoding)
pm = "\xb1"
except:
pass
return u"{mean} {pm} {std} per loop (mean {pm} std. dev. of {runs} run{run_plural}, {loops} loop{loop_plural} each)".format(
return "{mean} {pm} {std} per loop (mean {pm} std. dev. of {runs} run{run_plural}, {loops} loop{loop_plural} each)".format(
pm=pm,
runs=self.repeat,
loops=self.loops,
Expand All @@ -119,7 +119,7 @@ def __str__(self):

def _repr_pretty_(self, p, cycle):
unic = self.__str__()
p.text(u"<TimeitResult : " + unic + u">")
p.text("<TimeitResult : " + unic + ">")


class TimeitTemplateFiller(ast.NodeTransformer):
Expand Down Expand Up @@ -1519,7 +1519,7 @@ def _format_time(timespan, precision=3):
value = int(leftover / length)
if value > 0:
leftover = leftover % length
time.append(u"%s%s" % (str(value), suffix))
time.append("%s%s" % (str(value), suffix))
if leftover < 1:
break
return " ".join(time)
Expand All @@ -1529,11 +1529,11 @@ def _format_time(timespan, precision=3):
# See bug: https://bugs.launchpad.net/ipython/+bug/348466
# Try to prevent crashes by being more secure than it needs to
# E.g. eclipse is able to print a µ, but has no sys.stdout.encoding set.
units = [u"s", u"ms", u"us", "ns"] # the save value
units = ["s", "ms", "us", "ns"] # the save value
if hasattr(sys.stdout, "encoding") and sys.stdout.encoding:
try:
u"\xb5".encode(sys.stdout.encoding)
units = [u"s", u"ms", u"\xb5s", "ns"]
"\xb5".encode(sys.stdout.encoding)
units = ["s", "ms", "\xb5s", "ns"]
except:
pass
scaling = [1, 1e3, 1e6, 1e9]
Expand Down

0 comments on commit 7eb668f

Please sign in to comment.