whois/__init__.py
branchpython3
changeset 70 1fe2c20adeba
parent 60 7801a420f679
child 71 b181f795cc0d
--- a/whois/__init__.py	Mon Sep 14 15:19:11 2015 +0100
+++ b/whois/__init__.py	Sun Feb 07 22:30:17 2016 +0100
@@ -1,10 +1,17 @@
+from __future__ import print_function
+from __future__ import absolute_import
+from __future__ import unicode_literals
+from __future__ import division
+from future import standard_library
+standard_library.install_aliases()
+from builtins import *
 import re
 import sys
 import os
 import subprocess
 import socket
-from parser import WhoisEntry
-from whois import NICClient
+from .parser import WhoisEntry
+from .whois import NICClient
 
 
 def whois(url, command=False):
@@ -50,7 +57,7 @@
         if not line.startswith('#')
     ]
 
-    if type(url) is not unicode:
+    if type(url) is not str:
         url = url.decode('utf-8')
     url = re.sub('^.*://', '', url.encode('idna')).split('/')[0].lower()
     domain = []
@@ -67,6 +74,6 @@
     try:
         url = sys.argv[1]
     except IndexError:
-        print 'Usage: %s url' % sys.argv[0]
+        print('Usage: %s url' % sys.argv[0])
     else:
-        print whois(url)
+        print(whois(url))