Skip to content

Commit

Permalink
Merge pull request #30 from a-detiste/main
Browse files Browse the repository at this point in the history
remove more Python2 compat code
  • Loading branch information
cokelaer committed Apr 28, 2024
2 parents bc2ffc5 + ca41dfd commit 847f482
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
6 changes: 1 addition & 5 deletions easydev/config_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@
# Documentation: http://packages.python.org/easydev
#
##############################################################################
try:
from ConfigParser import ConfigParser
except ImportError:
from configparser import ConfigParser

import os
from configparser import ConfigParser

__all__ = ["CustomConfig", "DynamicConfigParser"]

Expand Down
7 changes: 2 additions & 5 deletions easydev/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@
#
##############################################################################
"""Utilities related to the web"""
try:
import httplib
except ImportError:
import http.client as httplib
import http.client as httplib


__all__ = ["isurl_reachable"]
Expand All @@ -37,7 +34,7 @@ def isurl_reachable(url, timeout=10, path="/"): # pragma: no cover
"""
if url.startswith("http://") or url.startswith("https://"):
url = url.split("//")[1]
conn = httplib.HTTPConnection(url, timeout=timeout)
conn = http.client.HTTPConnection(url, timeout=timeout)
try:
conn.request("HEAD", path)
except:
Expand Down

0 comments on commit 847f482

Please sign in to comment.