First test of py3 version

This commit is contained in:
Benjamyn Love 2018-08-26 23:59:23 +10:00
parent 516796ee15
commit 068743545b
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ from setuptools import setup, find_packages
import sys, os
__version__ = '0.1'
__version__ = '0.2'
setup(name='whois',
version=__version__,

View File

@ -12,9 +12,9 @@ import socket
import re
import logging
import urllib
import urllib2
#import urllib2
import error
#import errormyhost
import flags
class Whois(object):
@ -61,13 +61,13 @@ class Whois(object):
if self.settings.get("http-method").lower() == "post":
logging.debug("sendHTTPQuery: Connecting to whois server using POST")
req = urllib2.Request(whoisServer, param)
req = urllib.Request(whoisServer, param)
else: # GET
logging.debug("sendHTTPQuery: Connecting to whois server using GET")
req = urllib2.Request((whoisServer.endswith("?") and whoisServer or whoisServer+"?") + param)
req = urllib.Request((whoisServer.endswith("?") and whoisServer or whoisServer+"?") + param)
data = urllib2.urlopen(req).read()
print data
data = urllib.urlopen(req).read()
print(data)
return data