10000 change method to get label's name · pythonthings/github3.py@8cd184d · GitHub
[go: up one dir, main page]

Skip to content

Commit 8cd184d

Browse files
author
Matthew
committed
change method to get label's name
1 parent 89c3a6e commit 8cd184d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

github3/issues/issue.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,7 @@ def close(self):
147147
"""
148148
assignee = self.assignee.login if self.assignee else ''
149149
number = self.milestone.number if self.milestone else None
150-
try:
151-
labels = [str(l) for l in self.original_labels]
152-
except UnicodeEncodeError:
153-
labels = [l.name for l in self.original_labels]
150+
labels = [l.name for l in self.original_labels]
154151

155152
return self.edit(self.title, self.body, assignee, 'closed',
156153
number, labels)

tests/unit/test_issues_issue.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,7 @@ def test_assign_empty_username(self):
119119
def test_close(self):
120120
"""Verify the request for closing an issue."""
121121
self.instance.close()
122-
try:
123-
labels = [str(label) for label in self.instance.original_labels]
124-
except UnicodeEncodeError:
125-
labels = [label.name for label in self.instance.original_labels]
122+
labels = [label.name for label in self.instance.original_labels]
126123

127124
self.patch_called_with(
128125
url_for(),
@@ -173,7 +170,7 @@ def test_comment_positive_id(self):
173170
assert self.session.get.called is False
174171

175172
def test_close_with_unicode_labels(self):
176-
"""Verify the request for closeing an issue."""
173+
"""Verify the request for closing an issue."""
177174
data = {
178175
'title': 'issue title',
179176
'body': 'issue body',

0 commit comments

Comments
 (0)
0