diff options
author | Erik Johnston <erik@matrix.org> | 2019-12-12 15:21:12 +0000 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2019-12-12 15:21:12 +0000 |
commit | 495005360cd37009818ad4214a5462c3dd0b15a6 (patch) | |
tree | 4028a737f4294313814469b5798ed7cc9f81813c /synapse/logging | |
parent | Newsfile (diff) | |
download | synapse-495005360cd37009818ad4214a5462c3dd0b15a6.tar.xz |
Bump version of mypy
Diffstat (limited to 'synapse/logging')
-rw-r--r-- | synapse/logging/_terse_json.py | 2 | ||||
-rw-r--r-- | synapse/logging/context.py | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/synapse/logging/_terse_json.py b/synapse/logging/_terse_json.py index 03934956f4..c0b9384189 100644 --- a/synapse/logging/_terse_json.py +++ b/synapse/logging/_terse_json.py @@ -171,7 +171,7 @@ class LogProducer(object): def stopProducing(self): self._paused = True - self._buffer = None + self._buffer = deque() def resumeProducing(self): self._paused = False diff --git a/synapse/logging/context.py b/synapse/logging/context.py index 6747f29e6a..33b322209d 100644 --- a/synapse/logging/context.py +++ b/synapse/logging/context.py @@ -405,6 +405,9 @@ class LoggingContext(object): """ current = get_thread_resource_usage() + # Indicate to mypy that we know that self.usage_start is None. + assert self.usage_start is not None + utime_delta = current.ru_utime - self.usage_start.ru_utime stime_delta = current.ru_stime - self.usage_start.ru_stime |