Package: python-cheroot / 10.0.1+ds1-4

Remove-dependency-on-pypytools.patch Patch series | 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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
From: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Date: Tue, 13 Dec 2022 16:53:53 +0100
Subject: Remove dependency on pypytools

Pypytools is not packaged in Debian/Ubuntu.

Forwarded: not-needed
---
 cheroot/test/test_server.py | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

--- python-cheroot.orig/cheroot/test/test_server.py
+++ python-cheroot/cheroot/test/test_server.py
@@ -1,5 +1,6 @@
 """Tests for the HTTP server."""
 
+import gc
 import os
 import queue
 import socket
@@ -13,8 +14,6 @@
 import requests
 import requests_unixsocket
 
-from pypytools.gc.custom import DefaultGc
-
 from .._compat import bton, ntob
 from .._compat import IS_LINUX, IS_MACOS, IS_WINDOWS, SYS_PLATFORM
 from ..server import IS_UID_GID_RESOLVABLE, Gateway, HTTPServer
@@ -408,11 +407,17 @@
         test_high_number_of_file_descriptors,
     )
 
+class GcWrapper:
+    def __enter__(self):
+        gc.disable()
+
+    def __exit__(self, exc_type, exc_val, exc_tb):
+        gc.enable()
 
 @pytest.fixture
 def _garbage_bin():
     """Disable garbage collection when this fixture is in use."""
-    with DefaultGc().nogc():
+    with GcWrapper():
         yield