Permalink
Browse files

Simplify HTTPBasicAuth arguments.

This makes sf2github compatible with older python-requests
versions, such as 0.8.2 (shipped e.g. with Ubuntu 12.04).
  • Loading branch information...
1 parent fdad3d1 commit a887c2b8faac16e4238f5ef374d12e3e2e5a86cb @ockham committed Mar 16, 2013
Showing with 2 additions and 3 deletions.
  1. +2 −3 issues.py
View
@@ -34,17 +34,16 @@
from time import sleep
from getpass import getpass
import requests
-from requests.auth import HTTPBasicAuth
import json
import re
def __rest_call_unchecked(method, request, data=None):
global github_repo, github_user, github_password
url = 'https://api.github.com/repos/%s/%s' % (github_repo, request)
if method == 'PATCH':
- response = requests.patch(url, data=json.dumps(data), auth=HTTPBasicAuth(github_user, github_password))
+ response = requests.patch(url, data=json.dumps(data), auth=(github_user, github_password))
else:
- response = requests.post(url, data=json.dumps(data), auth=HTTPBasicAuth(github_user, github_password))
+ response = requests.post(url, data=json.dumps(data), auth=(github_user, github_password))
# GitHub limits API calls to 60 per minute
sleep(1)
return response

0 comments on commit a887c2b

Please sign in to comment.