File: iterable-import-from-collections.abc.patch

package info (click to toggle)
python-marathon 0.13.0-8
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 460 kB
  • sloc: python: 1,969; makefile: 185; sh: 58
file content (27 lines) | stat: -rw-r--r-- 1,257 bytes parent folder | download | duplicates (3)
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
Description: Iterable import from collections.abc
 Iterable has moved to collections.abc a long time ago.
Author: Thomas Goirand <zigo@debian.org>
Bug-Debian: https://bugs.debian.org/1009460
Forwarded: no
Last-Update: 2022-05-01

--- python-marathon-0.13.0.orig/marathon/util.py
+++ python-marathon-0.13.0/marathon/util.py
@@ -24,7 +24,7 @@ class MarathonJsonEncoder(json.JSONEncod
         if isinstance(obj, datetime.datetime):
             return obj.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
 
-        if isinstance(obj, collections.Iterable) and not isinstance(obj, str):
+        if isinstance(obj, collections.abc.Iterable) and not isinstance(obj, str):
             try:
                 return {k: self.default(v) for k, v in obj.items()}
             except AttributeError:
@@ -44,7 +44,7 @@ class MarathonMinimalJsonEncoder(json.JS
         if isinstance(obj, datetime.datetime):
             return obj.strftime('%Y-%m-%dT%H:%M:%S.%fZ')
 
-        if isinstance(obj, collections.Iterable) and not isinstance(obj, str):
+        if isinstance(obj, collections.abc.Iterable) and not isinstance(obj, str):
             try:
                 return {k: self.default(v) for k, v in obj.items() if (v or v in (False, 0))}
             except AttributeError: