Skip to content

Commit 4b5edf4

Browse files
committed
Don't repeatably call str.upper() when testing method name.
1 parent 62d95cc commit 4b5edf4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

github2/core.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ def make_request(self, command, *args, **kwargs):
141141
page = kwargs.pop("page", 1)
142142
if page and not page == 1:
143143
post_data["page"] = page
144-
method = kwargs.get("method", "GET")
145-
if method.upper() == "POST" or method.upper() == "GET" and post_data:
144+
method = kwargs.get("method", "GET").upper()
145+
if method == "POST" or method == "GET" and post_data:
146146
response = self.request.post(self.domain, command, *args,
147147
**post_data)
148-
elif method.upper() == "PUT":
148+
elif method == "PUT":
149149
response = self.request.put(self.domain, command, *args,
150150
**post_data)
151-
elif method.upper() == "DELETE":
151+
elif method == "DELETE":
152152
response = self.request.delete(self.domain, command, *args,
153153
**post_data)
154154
else:

0 commit comments

Comments
 (0)