Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdd210a3

Browse files
committed
Fix deprecation warning for 3.7 and up
Fixsigmavirus24#963
1 parent043d61f commitdd210a3

File tree

4 files changed

+22
-7
lines changed

4 files changed

+22
-7
lines changed

‎AUTHORS.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,6 @@ Contributors
181181

182182
- Steven Nyman (@stevennyman)
183183

184-
- Tigran Tchougourian (@NargiT)
184+
- Tigran Tchougourian (@NargiT)
185+
186+
- Dimitri Merejkowsky (@dmerejkowsky)

‎src/github3/session.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# -*- coding: utf-8 -*-
22
"""Module containing session and auth logic."""
3-
fromcollectionsimportCallable
3+
try:
4+
importcollections.abcasabc_collections
5+
exceptImportError:
6+
# For Python 2.7 compatibility
7+
importcollectionsasabc_collections
8+
49
importdatetime
510
fromcontextlibimportcontextmanager
611
fromloggingimportgetLogger
@@ -193,7 +198,7 @@ def two_factor_auth_callback(self, callback):
193198
ifnotcallback:
194199
return
195200

196-
ifnotisinstance(callback,Callable):
201+
ifnotisinstance(callback,abc_collections.Callable):
197202
raiseValueError("Your callback should be callable")
198203

199204
self.two_factor_auth_cb=callback

‎src/github3/structs.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# -*- coding: utf-8 -*-
2-
importcollections
2+
try:
3+
importcollections.abcasabc_collections
4+
exceptImportError:
5+
# For Python 2.7 compatibility
6+
importcollectionsasabc_collections
37
importfunctools
48

59
fromrequests.compatimporturlparse,urlencode
@@ -8,7 +12,7 @@
812
from .importmodels
913

1014

11-
classGitHubIterator(models.GitHubCore,collections.Iterator):
15+
classGitHubIterator(models.GitHubCore,abc_collections.Iterator):
1216
"""The :class:`GitHubIterator` class powers all of the iter_* methods."""
1317

1418
def__init__(

‎src/github3/utils.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# -*- coding: utf-8 -*-
22
"""A collection of useful utilities."""
3-
importcollections
3+
try:
4+
importcollections.abcasabc_collections
5+
exceptImportError:
6+
# For Python 2.7 compatibility
7+
importcollectionsasabc_collections
48
importdatetime
59
importre
610

@@ -68,7 +72,7 @@ def stream_response_to_file(response, path=None):
6872
fd=None
6973
filename=None
7074
ifpath:
71-
ifisinstance(getattr(path,"write",None),collections.Callable):
75+
ifisinstance(getattr(path,"write",None),abc_collections.Callable):
7276
pre_opened=True
7377
fd=path
7478
filename=getattr(fd,"name",None)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp