Package: ryu / 4.26+dfsg1-5

fix-ut-when-running-in-python-3.7-env.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
Description: Fix UT when running in python 3.7 env
 Due to change [1] in python 3.7 one of ryu's unit tests
 was failing with this version of interpreter. It was like that
 because of missing qualname attribute in functools.partial
 object.
 This patch fixes it by adding such attribute if it's not
 set already.
 .
 [1] python/cpython#4496
Author: Slawek Kaplonski <skaplons@redhat.com>
Bug-Debian: https://bugs.debian.org/917661
Origin: upstream, https://github.com/osrg/ryu/commit/bb3963b448b542c3aeac5fb9f3f15fcee5c2b423.patch
Last-Update: 2018-12-30

--- ryu-4.26+dfsg1.orig/ryu/tests/test_lib.py
+++ ryu-4.26+dfsg1/ryu/tests/test_lib.py
@@ -267,6 +267,8 @@ def add_method(cls, method_name, method)
     method.__name__ = method_name
     if six.PY3:
         methodtype = types.MethodType(method, cls)
+        if not hasattr(method, "__qualname__"):
+            method.__qualname__ = "%s.%s" % (cls.__qualname__, method_name)
     else:
         methodtype = types.MethodType(method, None, cls)
     setattr(cls, method_name, methodtype)