mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 10:46:06 -04:00
Enable mypy checking for unreachable code and fix instances. (#8432)
This commit is contained in:
parent
c1ef579b63
commit
4ff0201e62
17 changed files with 38 additions and 53 deletions
|
@ -12,7 +12,6 @@
|
|||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import logging
|
||||
import os.path
|
||||
import sys
|
||||
|
@ -89,14 +88,7 @@ class LogContextObserver:
|
|||
context = current_context()
|
||||
|
||||
# Copy the context information to the log event.
|
||||
if context is not None:
|
||||
context.copy_to_twisted_log_entry(event)
|
||||
else:
|
||||
# If there's no logging context, not even the root one, we might be
|
||||
# starting up or it might be from non-Synapse code. Log it as if it
|
||||
# came from the root logger.
|
||||
event["request"] = None
|
||||
event["scope"] = None
|
||||
context.copy_to_twisted_log_entry(event)
|
||||
|
||||
self.observer(event)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue