Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A very narrow attempt at Python 3.10 support #380

Merged
merged 1 commit into from
Dec 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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