Skip to content

Commit

Permalink
Use httplib on Python 2 instead of http.client
Browse files Browse the repository at this point in the history
  • Loading branch information
AjayP13 committed Nov 9, 2018
1 parent 43c1a67 commit 6a2cc3c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions supersqlite/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from __future__ import unicode_literals

import bisect
import http.client
import hashlib
import heapq
import mmap
Expand All @@ -20,8 +19,10 @@

try:
from http.client import CannotSendRequest, ResponseNotReady
import http.client as httplib
except BaseException:
from httplib import CannotSendRequest, ResponseNotReady
import httplib

try:
from urllib.parse import urlparse
Expand Down Expand Up @@ -772,10 +773,10 @@ def __init__(self, inheritfromvfsname, name, flags, vfs, options=None):
def _new_connection(self):
"""Creates an HTTP connection"""
if self.parsed_url.scheme.lower() == 'http':
return http.client.HTTPConnection(
return httplib.HTTPConnection(
self.parsed_url.netloc, timeout=60)
else:
return http.client.HTTPSConnection(
return httplib.HTTPSConnection(
self.parsed_url.netloc, timeout=60)

def _prepare_connection(self, new=True):
Expand Down

0 comments on commit 6a2cc3c

Please sign in to comment.