diff options
author | Michał Górny <mgorny@gentoo.org> | 2022-05-13 08:59:25 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2022-05-13 11:07:56 +0200 |
commit | 35339ca7928eeb3ee59b381d1bb3d715055e3e73 (patch) | |
tree | cb19b76e49cd3dd0b20e346af740e71d0f912bc7 /dev-python/twisted/files | |
parent | dev-python/incremental: Enable py3.11 (diff) | |
download | gentoo-35339ca7928eeb3ee59b381d1bb3d715055e3e73.tar.gz gentoo-35339ca7928eeb3ee59b381d1bb3d715055e3e73.tar.bz2 gentoo-35339ca7928eeb3ee59b381d1bb3d715055e3e73.zip |
dev-python/twisted: Enable py3.11
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/twisted/files')
-rw-r--r-- | dev-python/twisted/files/twisted-22.4.0-py311.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dev-python/twisted/files/twisted-22.4.0-py311.patch b/dev-python/twisted/files/twisted-22.4.0-py311.patch new file mode 100644 index 000000000000..ed8ded87d4de --- /dev/null +++ b/dev-python/twisted/files/twisted-22.4.0-py311.patch @@ -0,0 +1,55 @@ +From 074fc742a699278ea5266b34aace1e34049b3de3 Mon Sep 17 00:00:00 2001 +From: Colin Watson <cjwatson@canonical.com> +Date: Sat, 23 Apr 2022 22:29:07 +0100 +Subject: [PATCH] Implement twisted.python.failure._Code.co_positions + +This is needed for compatibility with Python 3.11. +--- + src/twisted/newsfragments/10336.bugfix | 1 + + src/twisted/python/failure.py | 5 ++++- + src/twisted/test/test_failure.py | 1 + + 3 files changed, 6 insertions(+), 1 deletion(-) + create mode 100644 src/twisted/newsfragments/10336.bugfix + +diff --git a/src/twisted/newsfragments/10336.bugfix b/src/twisted/newsfragments/10336.bugfix +new file mode 100644 +index 00000000000..a7ffab3627d +--- /dev/null ++++ b/src/twisted/newsfragments/10336.bugfix +@@ -0,0 +1 @@ ++Implement twisted.python.failure._Code.co_positions for compatibility with Python 3.11. +diff --git a/src/twisted/python/failure.py b/src/twisted/python/failure.py +index 6471e7bca59..c5a359e405b 100644 +--- a/src/twisted/python/failure.py ++++ b/src/twisted/python/failure.py +@@ -130,7 +130,7 @@ def _Traceback(stackFrames, tbFrames): + + + # The set of attributes for _TracebackFrame, _Frame and _Code were taken from +-# https://docs.python.org/3.10/library/inspect.html Other Pythons may have a ++# https://docs.python.org/3.11/library/inspect.html Other Pythons may have a + # few more attributes that should be added if needed. + class _TracebackFrame: + """ +@@ -202,6 +202,9 @@ def __init__(self, name, filename): + self.co_nlocals = 0 + self.co_stacksize = 0 + ++ def co_positions(self): ++ return ((None, None, None, None),) ++ + + _inlineCallbacksExtraneous = [] + +diff --git a/src/twisted/test/test_failure.py b/src/twisted/test/test_failure.py +index 6dd7c682bf9..6fd82c868ec 100644 +--- a/src/twisted/test/test_failure.py ++++ b/src/twisted/test/test_failure.py +@@ -825,6 +825,7 @@ def test_fakeCodeAttributes(self): + self.assertIsInstance(code.co_nlocals, int) + self.assertIsInstance(code.co_stacksize, int) + self.assertIsInstance(code.co_varnames, list) ++ self.assertIsInstance(code.co_positions(), tuple) + + def test_fakeTracebackFrame(self): + """ |