mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-08-02 08:26:03 -04:00
Bump black
and click
versions (#12320)
This commit is contained in:
parent
6f2943714b
commit
a2b00a4486
16 changed files with 37 additions and 30 deletions
|
@ -23,7 +23,7 @@ from typing_extensions import Final
|
|||
MAX_PDU_SIZE = 65536
|
||||
|
||||
# the "depth" field on events is limited to 2**63 - 1
|
||||
MAX_DEPTH = 2 ** 63 - 1
|
||||
MAX_DEPTH = 2**63 - 1
|
||||
|
||||
# the maximum length for a room alias is 255 characters
|
||||
MAX_ALIAS_LENGTH = 255
|
||||
|
|
|
@ -428,7 +428,7 @@ class _Recoverer:
|
|||
"as-recoverer-%s" % (self.service.id,), self.retry
|
||||
)
|
||||
|
||||
delay = 2 ** self.backoff_counter
|
||||
delay = 2**self.backoff_counter
|
||||
logger.info("Scheduling retries on %s in %fs", self.service.id, delay)
|
||||
self.clock.call_later(delay, _retry)
|
||||
|
||||
|
|
|
@ -182,7 +182,7 @@ class Keyring:
|
|||
vk = get_verify_key(hs.signing_key)
|
||||
self._local_verify_keys[f"{vk.alg}:{vk.version}"] = FetchKeyResult(
|
||||
verify_key=vk,
|
||||
valid_until_ts=2 ** 63, # fake future timestamp
|
||||
valid_until_ts=2**63, # fake future timestamp
|
||||
)
|
||||
|
||||
async def verify_json_for_server(
|
||||
|
|
|
@ -49,7 +49,7 @@ if TYPE_CHECKING:
|
|||
# the literal fields "foo\" and "bar" but will instead be treated as "foo\\.bar"
|
||||
SPLIT_FIELD_REGEX = re.compile(r"(?<!\\)\.")
|
||||
|
||||
CANONICALJSON_MAX_INT = (2 ** 53) - 1
|
||||
CANONICALJSON_MAX_INT = (2**53) - 1
|
||||
CANONICALJSON_MIN_INT = -CANONICALJSON_MAX_INT
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ from synapse.types import ISynapseReactor
|
|||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_VALID_URI = re.compile(br"\A[\x21-\x7e]+\Z")
|
||||
_VALID_URI = re.compile(rb"\A[\x21-\x7e]+\Z")
|
||||
|
||||
|
||||
@implementer(IAgent)
|
||||
|
|
|
@ -275,7 +275,7 @@ class ReplicationEndpoint(metaclass=abc.ABCMeta):
|
|||
if attempts > cls.RETRY_ON_CONNECT_ERROR_ATTEMPTS:
|
||||
raise
|
||||
|
||||
delay = 2 ** attempts
|
||||
delay = 2**attempts
|
||||
logger.warning(
|
||||
"%s request connection failed; retrying in %ds: %r",
|
||||
cls.NAME,
|
||||
|
|
|
@ -352,7 +352,7 @@ class ReadableFileWrapper:
|
|||
`IConsumer`.
|
||||
"""
|
||||
|
||||
CHUNK_SIZE = 2 ** 14
|
||||
CHUNK_SIZE = 2**14
|
||||
|
||||
clock: Clock
|
||||
path: str
|
||||
|
|
|
@ -23,10 +23,10 @@ if TYPE_CHECKING:
|
|||
logger = logging.getLogger(__name__)
|
||||
|
||||
_charset_match = re.compile(
|
||||
br'<\s*meta[^>]*charset\s*=\s*"?([a-z0-9_-]+)"?', flags=re.I
|
||||
rb'<\s*meta[^>]*charset\s*=\s*"?([a-z0-9_-]+)"?', flags=re.I
|
||||
)
|
||||
_xml_encoding_match = re.compile(
|
||||
br'\s*<\s*\?\s*xml[^>]*encoding="([a-z0-9_-]+)"', flags=re.I
|
||||
rb'\s*<\s*\?\s*xml[^>]*encoding="([a-z0-9_-]+)"', flags=re.I
|
||||
)
|
||||
_content_type_match = re.compile(r'.*; *charset="?(.*?)"?(;|$)', flags=re.I)
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ if TYPE_CHECKING:
|
|||
from synapse.server import HomeServer
|
||||
|
||||
# python 3 does not have a maximum int value
|
||||
MAX_TXN_ID = 2 ** 63 - 1
|
||||
MAX_TXN_ID = 2**63 - 1
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -217,13 +217,16 @@ def _check_yield_points(
|
|||
# We don't raise here as its perfectly valid for contexts to
|
||||
# change in a function, as long as it sets the correct context
|
||||
# on resolving (which is checked separately).
|
||||
err = "%s changed context from %s to %s, happened between lines %d and %d in %s" % (
|
||||
frame.f_code.co_name,
|
||||
expected_context,
|
||||
current_context(),
|
||||
last_yield_line_no,
|
||||
frame.f_lineno,
|
||||
frame.f_code.co_filename,
|
||||
err = (
|
||||
"%s changed context from %s to %s, happened between lines %d and %d in %s"
|
||||
% (
|
||||
frame.f_code.co_name,
|
||||
expected_context,
|
||||
current_context(),
|
||||
last_yield_line_no,
|
||||
frame.f_lineno,
|
||||
frame.f_code.co_filename,
|
||||
)
|
||||
)
|
||||
changes.append(err)
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ MIN_RETRY_INTERVAL = 10 * 60 * 1000
|
|||
RETRY_MULTIPLIER = 5
|
||||
|
||||
# a cap on the backoff. (Essentially none)
|
||||
MAX_RETRY_INTERVAL = 2 ** 62
|
||||
MAX_RETRY_INTERVAL = 2**62
|
||||
|
||||
|
||||
class NotRetryingDestination(Exception):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue