Skip to content

Commit

Permalink
Merge pull request #380 from GoSecure/python-3.10
Browse files Browse the repository at this point in the history
A very narrow attempt at Python 3.10 support
  • Loading branch information
obilodeau committed Dec 30, 2021
2 parents 44e94a9 + 41179b4 commit 4a285c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyrdp/logging/StatCounter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
# Licensed under the GPLv3 or later.
#

import collections
import time
from collections.abc import Mapping
from logging import LoggerAdapter
from typing import Optional

Expand Down Expand Up @@ -156,15 +156,15 @@ def stop(self):
if self.stats[STAT.TOTAL_OUTPUT] > 0:
self.stats[STAT.CLIENT_SERVER_RATIO] = self.stats[STAT.TOTAL_INPUT] / self.stats[STAT.TOTAL_OUTPUT]

def logReport(self, log: LoggerAdapter, more_info: Optional[collections.Mapping] = None):
def logReport(self, log: LoggerAdapter, more_info: Optional[Mapping] = None):
"""
Create an INFO log message to log the Connection report using the keys in self.stats.
:param log: Logger to use to log the report
:param more_info: A dictionary-like object of more information to merge
in the connection report
"""
# merge in the additional data if required
if isinstance(more_info, collections.Mapping):
if isinstance(more_info, Mapping):
report_data = {**self.stats, **more_info}
else:
report_data = self.stats
Expand Down

0 comments on commit 4a285c8

Please sign in to comment.