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

Commitaea20f5

Browse files
committed
Fix python3 tests and the test error.
Apparently author isn't always present. Interesting.
1 parentced6d55 commitaea20f5

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎github3/decorators.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
fromStringIOimportStringIO
1515
exceptImportError:
1616
# python3
17-
fromioimportStringIO
17+
fromioimportBytesIOasStringIO
1818

1919

2020
defrequires_auth(func):
@@ -42,6 +42,7 @@ def auth_wrapper(self, *args, **kwargs):
4242
# Mock a 401 response
4343
r=Response()
4444
r.status_code=401
45-
r.raw=StringIO('{"message": "Requires authentication"}')
45+
r.encoding='utf-8'
46+
r.raw=StringIO('{"message": "Requires authentication"}'.encode())
4647
raiseGitHubError(r)
4748
returnauth_wrapper

‎github3/git.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,12 @@ def __init__(self, commit, session=None):
6060

6161
#: dict containing at least the name, email and date the commit was
6262
# created
63-
self.author=commit.get('author')
63+
self.author=commit.get('author', {})
6464
self._author_name=self.author.get('name','')
6565

6666
#: dict containing similar information to the author attribute
67-
self.committer=commit.get('committer')
68-
ifcommit.get('committer'):
69-
self.committer=User(commit.get('committer'),None)
67+
self.committer=commit.get('committer', {})
68+
self._commit_name=self.committer.get('name','')
7069

7170
#: :class:`Tree <Tree>` the commit belongs to.
7271
self.tree=None

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp