This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git


The following commit(s) were added to refs/heads/main by this push:
     new c56cb25b0 NO-JIRA: [Python] Remove some obsolete python workarounds
c56cb25b0 is described below

commit c56cb25b00554829f2229838b431d0eed496e8d8
Author: Andrew Stitcher <astitc...@apache.org>
AuthorDate: Tue Mar 4 15:39:30 2025 -0500

    NO-JIRA: [Python] Remove some obsolete python workarounds
---
 python/proton/_data.py              | 10 ----------
 python/proton/_reactor.py           | 13 +------------
 python/proton/_utils.py             | 13 +------------
 python/tests/proton_tests/engine.py |  4 ----
 4 files changed, 2 insertions(+), 38 deletions(-)

diff --git a/python/proton/_data.py b/python/proton/_data.py
index fb02e9f27..8ac2c986d 100644
--- a/python/proton/_data.py
+++ b/python/proton/_data.py
@@ -19,16 +19,6 @@
 
 import uuid
 from typing import Callable, List, Tuple, Union, Optional, Any, Dict, 
Iterable, TypeVar
-try:
-    from typing import Literal
-except ImportError:
-    # https://www.python.org/dev/peps/pep-0560/#class-getitem
-    class GenericMeta(type):
-        def __getitem__(self, item):
-            pass
-
-    class Literal(metaclass=GenericMeta):  # type: ignore[no-redef]
-        pass
 
 from cproton import PN_ARRAY, PN_BINARY, PN_BOOL, PN_BYTE, PN_CHAR, 
PN_DECIMAL128, PN_DECIMAL32, PN_DECIMAL64, \
     PN_DESCRIBED, PN_DOUBLE, PN_FLOAT, PN_INT, PN_LIST, PN_LONG, PN_MAP, 
PN_NULL, PN_OVERFLOW, PN_SHORT, PN_STRING, \
diff --git a/python/proton/_reactor.py b/python/proton/_reactor.py
index fc13135b6..1f32b4a67 100644
--- a/python/proton/_reactor.py
+++ b/python/proton/_reactor.py
@@ -23,18 +23,7 @@ import logging
 import re
 import os
 import queue
-from typing import Any, Dict, Iterator, Optional, List, Union, Callable, 
TYPE_CHECKING, Tuple, Type
-
-try:
-    from typing import Literal
-except ImportError:
-    # https://www.python.org/dev/peps/pep-0560/#class-getitem
-    class GenericMeta(type):
-        def __getitem__(self, item):
-            pass
-
-    class Literal(metaclass=GenericMeta):
-        pass
+from typing import Any, Dict, Iterator, Optional, List, Literal, Union, 
Callable, TYPE_CHECKING, Tuple, Type
 
 import time
 import traceback
diff --git a/python/proton/_utils.py b/python/proton/_utils.py
index 24b7e235d..65023c8ef 100644
--- a/python/proton/_utils.py
+++ b/python/proton/_utils.py
@@ -30,18 +30,7 @@ from ._url import Url
 from ._reactor import Container
 from ._handlers import MessagingHandler, IncomingMessageHandler
 
-from typing import Callable, Optional, Union, TYPE_CHECKING, List, Any
-
-try:
-    from typing import Literal
-except ImportError:
-    # https://www.python.org/dev/peps/pep-0560/#class-getitem
-    class GenericMeta(type):
-        def __getitem__(self, item):
-            pass
-
-    class Literal(metaclass=GenericMeta):
-        pass
+from typing import Callable, Optional, Literal, Union, TYPE_CHECKING, List, Any
 
 if TYPE_CHECKING:
     from ._delivery import DispositionType
diff --git a/python/tests/proton_tests/engine.py 
b/python/tests/proton_tests/engine.py
index 1b5ab1d2a..bddce0a78 100644
--- a/python/tests/proton_tests/engine.py
+++ b/python/tests/proton_tests/engine.py
@@ -27,10 +27,6 @@ from . import common
 from .common import pump, Skipped
 
 
-# older versions of gc do not provide the garbage list
-if not hasattr(gc, "garbage"):
-    gc.garbage = []
-
 # future test areas
 #  + different permutations of setup
 #   - creating deliveries and calling input/output before opening the 
session/link


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to