From ca2ca5d7cb2cbb0f251dc58fc27b8c5df0096a9b Mon Sep 17 00:00:00 2001 From: Markus Zolliker Date: Tue, 12 Dec 2023 11:40:45 +0100 Subject: [PATCH] remove py35 compatibility code as f-strings are heavily used now, compatibility to py35 can be removed Change-Id: I1ae4912ad4cbde8419b74845217943bd061053f3 Reviewed-on: https://forge.frm2.tum.de/review/c/secop/frappy/+/32754 Tested-by: Jenkins Automated Tests Reviewed-by: Enrico Faulhaber Reviewed-by: Markus Zolliker --- frappy/modulebase.py | 2 -- frappy/properties.py | 3 +-- frappy/protocol/interface/tcp.py | 7 ------- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/frappy/modulebase.py b/frappy/modulebase.py index de3bb70..4f5e2ad 100644 --- a/frappy/modulebase.py +++ b/frappy/modulebase.py @@ -109,8 +109,6 @@ class HasAccessibles(HasProperties): for aname in new_names: if aname not in paramOrder: accessibles.move_to_end(aname) - # note: for python < 3.6 the order of inherited items is not ensured between - # declarations within the same class cls.accessibles = accessibles cls.wrappedAttributes = {'isWrapped': True} diff --git a/frappy/properties.py b/frappy/properties.py index 616783f..47b83a1 100644 --- a/frappy/properties.py +++ b/frappy/properties.py @@ -27,12 +27,11 @@ import inspect from frappy.errors import BadValueError, ConfigError, ProgrammingError from frappy.lib import UniqueObject -from frappy.lib.py35compat import Object UNSET = UniqueObject('undefined value') #: an unset value, not even None -class HasDescriptors(Object): +class HasDescriptors: @classmethod def __init_subclass__(cls): # when migrating old style declarations, sometimes the trailing comma is not removed diff --git a/frappy/protocol/interface/tcp.py b/frappy/protocol/interface/tcp.py index 8f688cb..d3b9319 100644 --- a/frappy/protocol/interface/tcp.py +++ b/frappy/protocol/interface/tcp.py @@ -232,13 +232,6 @@ class TCPServer(DualStackTCPServer): self.log.warning('tried again %d times after "Address already in use"', ntry) self.log.info("TCPServer initiated") - # py35 compatibility - if not hasattr(socketserver.ThreadingTCPServer, '__exit__'): - def __enter__(self): - return self - - def __exit__(self, *args): - self.server_close() def format_address(addr): if len(addr) == 2: