From 64b8817c0d0616f84b764a11af0c37d180684caf Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 22 Mar 2022 13:30:34 +1100 Subject: [PATCH] all: Update formatting for new Black version 22.1.0. Signed-off-by: Damien George --- .../email.internal/email/_encoded_words.py | 2 +- python-stdlib/timeit/timeit.py | 2 +- unix-ffi/datetime/datetime.py | 2 +- unix-ffi/datetime/test_datetime.py | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/python-stdlib/email.internal/email/_encoded_words.py b/python-stdlib/email.internal/email/_encoded_words.py index d4c3380b..ac982cf0 100644 --- a/python-stdlib/email.internal/email/_encoded_words.py +++ b/python-stdlib/email.internal/email/_encoded_words.py @@ -63,7 +63,7 @@ __all__ = [ # regex based decoder. _q_byte_subber = functools.partial( - re.compile(br"=([a-fA-F0-9]{2})").sub, lambda m: bytes([int(m.group(1), 16)]) + re.compile(rb"=([a-fA-F0-9]{2})").sub, lambda m: bytes([int(m.group(1), 16)]) ) diff --git a/python-stdlib/timeit/timeit.py b/python-stdlib/timeit/timeit.py index 446394bd..fabcd51b 100644 --- a/python-stdlib/timeit/timeit.py +++ b/python-stdlib/timeit/timeit.py @@ -316,7 +316,7 @@ def main(args=None, *, _wrap_timer=None): if number == 0: # determine number so that 0.2 <= total time < 2.0 for i in range(1, 10): - number = 10 ** i + number = 10**i try: x = t.timeit(number) except: diff --git a/unix-ffi/datetime/datetime.py b/unix-ffi/datetime/datetime.py index f9eeb90f..8f3dff0d 100644 --- a/unix-ffi/datetime/datetime.py +++ b/unix-ffi/datetime/datetime.py @@ -476,7 +476,7 @@ class timedelta: def total_seconds(self): """Total seconds in the duration.""" - return ((self.days * 86400 + self.seconds) * 10 ** 6 + self.microseconds) / 10 ** 6 + return ((self.days * 86400 + self.seconds) * 10**6 + self.microseconds) / 10**6 # Read-only field accessors @property diff --git a/unix-ffi/datetime/test_datetime.py b/unix-ffi/datetime/test_datetime.py index 180ad194..463f2b28 100644 --- a/unix-ffi/datetime/test_datetime.py +++ b/unix-ffi/datetime/test_datetime.py @@ -611,7 +611,7 @@ class TestTimeDelta(HarmlessMixedComparison, unittest.TestCase): self.assertRaises(OverflowError, lambda: -timedelta.max) day = timedelta(1) - self.assertRaises(OverflowError, day.__mul__, 10 ** 9) + self.assertRaises(OverflowError, day.__mul__, 10**9) self.assertRaises(OverflowError, day.__mul__, 1e9) self.assertRaises(OverflowError, day.__truediv__, 1e-20) self.assertRaises(OverflowError, day.__truediv__, 1e-10) @@ -1692,7 +1692,7 @@ class TestDateTime(TestDate): self.assertRaises(TypeError, lambda: a + a) def test_pickling(self): - args = 6, 7, 23, 20, 59, 1, 64 ** 2 + args = 6, 7, 23, 20, 59, 1, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) @@ -1709,7 +1709,7 @@ class TestDateTime(TestDate): @unittest.skip("Skip pickling for MicroPython") def test_pickling_subclass_datetime(self): - args = 6, 7, 23, 20, 59, 1, 64 ** 2 + args = 6, 7, 23, 20, 59, 1, 64**2 orig = SubclassDatetime(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) @@ -2298,7 +2298,7 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase): self.assertTrue(self.theclass.max > self.theclass.min) def test_pickling(self): - args = 20, 59, 16, 64 ** 2 + args = 20, 59, 16, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) @@ -2307,7 +2307,7 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase): @unittest.skip("Skip pickling for MicroPython") def test_pickling_subclass_time(self): - args = 20, 59, 16, 64 ** 2 + args = 20, 59, 16, 64**2 orig = SubclassTime(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) @@ -2686,7 +2686,7 @@ class TestTimeTZ(TestTime, TZInfoBase, unittest.TestCase): def test_pickling(self): # Try one without a tzinfo. - args = 20, 59, 16, 64 ** 2 + args = 20, 59, 16, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto) @@ -2916,7 +2916,7 @@ class TestDateTimeTZ(TestDateTime, TZInfoBase, unittest.TestCase): def test_pickling(self): # Try one without a tzinfo. - args = 6, 7, 23, 20, 59, 1, 64 ** 2 + args = 6, 7, 23, 20, 59, 1, 64**2 orig = self.theclass(*args) for pickler, unpickler, proto in pickle_choices: green = pickler.dumps(orig, proto)