Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Support Python 2.5 again (issue #73)

  • Loading branch information...
commit fb62ca3fb2bece331ea35b1de9ddc81b39b3276e 1 parent 82b7322
@jacquev6 jacquev6 authored
Showing with 9 additions and 3 deletions.
  1. +9 −3 github/Requester.py
View
12 github/Requester.py
@@ -15,10 +15,13 @@
import base64
import urllib
import urlparse
+import sys
-try:
+atLeastPython26 = sys.hexversion >= 0x02060000
+
+if atLeastPython26:
import json
-except ImportError: #pragma no cover: only for Python 2.5
+else: #pragma no cover
import simplejson as json #pragma no cover
import GithubException
@@ -78,7 +81,10 @@ def requestRaw( self, verb, url, parameters, input ):
if self.__authorizationHeader is not None:
headers[ "Authorization" ] = self.__authorizationHeader
- cnx = self.__connectionClass( host = self.__hostname, port = self.__port, strict = True, timeout = self.__timeout )
+ if atLeastPython26:
+ cnx = self.__connectionClass( host = self.__hostname, port = self.__port, strict = True, timeout = self.__timeout )
+ else: #pragma no cover
+ cnx = self.__connectionClass( host = self.__hostname, port = self.__port, strict = True ) #pragma no cover
cnx.request(
verb,
self.__completeUrl( url, parameters ),
Please sign in to comment.
Something went wrong with that request. Please try again.