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 49 50 51 52 53 54 55 56 57
|
Description: Add support for python 3.10
Use 'collections.abc' instead of 'collections' since python 3.10 does not accept
this syntax anymore, it has been deprecated since python 3.3.
Author: Alexandre Ghiti <alexandre.ghiti@canonical.com>
Origin: vendor
Forwarded: https://github.com/donnemartin/gitsome/pull/191
Last-Update: 2022-01-28
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/gitsome/lib/github3/session.py
+++ b/gitsome/lib/github3/session.py
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
import requests
-from collections import Callable
+from collections.abc import Callable
from . import __version__
from logging import getLogger
from contextlib import contextmanager
--- a/gitsome/lib/github3/structs.py
+++ b/gitsome/lib/github3/structs.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-import collections
+import collections.abc
import functools
from requests.compat import urlparse, urlencode
@@ -8,7 +8,7 @@
from . import models
-class GitHubIterator(models.GitHubCore, collections.Iterator):
+class GitHubIterator(models.GitHubCore, collections.abc.Iterator):
"""The :class:`GitHubIterator` class powers all of the iter_* methods."""
def __init__(self, count, url, cls, session, params=None, etag=None,
headers=None):
--- a/gitsome/lib/github3/utils.py
+++ b/gitsome/lib/github3/utils.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""A collection of useful utilities."""
-import collections
+import collections.abc
import datetime
import re
@@ -81,7 +81,7 @@
fd = None
filename = None
if path:
- if isinstance(getattr(path, 'write', None), collections.Callable):
+ if isinstance(getattr(path, 'write', None), collections.abc.Callable):
pre_opened = True
fd = path
filename = getattr(fd, 'name', None)
|