Skip to content

Commit

Permalink
Update the black code formatter to 22.3.0. (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
reivilibre authored Jun 10, 2022
1 parent 2a2b3eb commit 0ff8ffc
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions changelog.d/307.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Update the `black` code formatter to 22.3.0.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

EXTRAS_REQUIRE = {
"dev": [
"black==21.6b0",
"black==22.3.0",
"coverage~=5.5",
"flake8==3.9.0",
"isort~=5.0",
Expand Down
2 changes: 1 addition & 1 deletion sygnal/apnspushkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ async def _dispatch_notification_unlimited(
log, span, device, shaved_payload, prio
)
except TemporaryNotificationDispatchException as exc:
retry_delay = self.RETRY_DELAY_BASE * (2 ** retry_number)
retry_delay = self.RETRY_DELAY_BASE * (2**retry_number)
if exc.custom_retry_delay is not None:
retry_delay = exc.custom_retry_delay

Expand Down
2 changes: 1 addition & 1 deletion sygnal/gcmpushkin.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ async def _dispatch_notification_unlimited(
if len(pushkeys) == 0:
break
except TemporaryNotificationDispatchException as exc:
retry_delay = RETRY_DELAY_BASE * (2 ** retry_number)
retry_delay = RETRY_DELAY_BASE * (2**retry_number)
if exc.custom_retry_delay is not None:
retry_delay = exc.custom_retry_delay

Expand Down
2 changes: 1 addition & 1 deletion sygnal/helper/proxy/proxyagent_twisted.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

logger = logging.getLogger(__name__)

_VALID_URI = re.compile(br"\A[\x21-\x7e]+\Z")
_VALID_URI = re.compile(rb"\A[\x21-\x7e]+\Z")


@implementer(IAgent)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_apnstruncate.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def test_python_unicode_support(self):
I have no great desire to manually parse UTF-8 to work around this since
it works fine on Linux.
"""
if len(u"\U0001F430") != 1:
if len("\U0001F430") != 1:
msg = (
"Unicode support is broken in your Python binary. "
+ "Truncating messages with multibyte unicode characters will fail."
Expand All @@ -152,7 +152,7 @@ def test_truncate_string_with_multibyte(self):
multibyte character.
"""
overhead = len(json_encode(payload_for_aps({"alert": ""})))
txt = u"\U0001F430" + simplestring(30)
txt = "\U0001F430" + simplestring(30)
aps = {"alert": txt}
# NB. The number of characters of the string we get is dependent
# on the json encoding used.
Expand Down

0 comments on commit 0ff8ffc

Please sign in to comment.