File: py313.patch

package info (click to toggle)
supervisor 4.2.5-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,728 kB
  • sloc: python: 29,856; makefile: 79; sh: 75
file content (31 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: Colin Watson <cjwatson@debian.org>
Date: Thu, 12 Dec 2024 22:31:34 +0000
Subject: Fix tests on Python 3.13

Python 3.13 added a `__firstlineno__` attribute to classes
(https://docs.python.org/3/reference/datamodel.html#type.__firstlineno__)
whose value is an int, so the approach taken by
`SubprocessTests.test_getProcessStateDescription` to test only actual
states no longer works.  Exclude all attributes starting with `__`
instead.

Forwarded: https://github.com/Supervisor/supervisor/pull/1668
Bug-Debian: https://bugs.debian.org/1089058
Last-Update: 2024-12-12
---
 supervisor/tests/test_process.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/supervisor/tests/test_process.py b/supervisor/tests/test_process.py
index d9370e2..24643b4 100644
--- a/supervisor/tests/test_process.py
+++ b/supervisor/tests/test_process.py
@@ -39,7 +39,7 @@ class SubprocessTests(unittest.TestCase):
         from supervisor.states import ProcessStates
         from supervisor.process import getProcessStateDescription
         for statename, code in ProcessStates.__dict__.items():
-            if isinstance(code, int):
+            if not statename.startswith("__"):
                 self.assertEqual(getProcessStateDescription(code), statename)
 
     def test_ctor(self):