Skip to content

Commit 2c38b36

Browse files
Barry Morrison and Ian Cordascosigmavirus24
authored andcommitted
Remove unnecessary import and add TODO comments
1 parent ee32241 commit 2c38b36

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

github3/github.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
88
"""
99

10-
from json import dumps
1110
from github3.auths import Authorization
1211
from github3.decorators import requires_auth, requires_basic_auth
1312
from github3.events import Event
@@ -102,13 +101,19 @@ def authorize(self, login, password, scopes=None, note='', note_url='',
102101
:returns: :class:`Authorization <Authorization>`
103102
"""
104103
json = None
104+
# TODO: Break this behaviour in 1.0 (Don't rely on self._session.auth)
105105
auth = self._session.auth or (login and password)
106106
if auth:
107107
url = self._build_url('authorizations')
108108
data = {'note': note, 'note_url': note_url,
109109
'client_id': client_id, 'client_secret': client_secret}
110110
if scopes:
111111
data['scopes'] = scopes
112+
# TODO: Unconditionally use the login and password, e.g.,
113+
# old_auth = self._session.auth
114+
# self.login(login, password)
115+
# json = self._json(...)
116+
# self._session.auth = old_auth
112117
do_logout = False
113118
if not self._session.auth:
114119
do_logout = True

0 commit comments

Comments
 (0)