diff --git a/src/xdgurl.py b/src/xdgurl.py
index a91662c239a91b822d03b21284183a0c4ec59c98..f5bc0f577511102210d95ffe8cd1c1de4638ae39 100644
--- a/src/xdgurl.py
+++ b/src/xdgurl.py
@@ -12,15 +12,19 @@ https://github.com/xdgurl/xdgurl
 import sys
 import os
 import json
-import urllib
 import tempfile
 import mimetypes
 import subprocess
 import argparse
 
 if sys.version_info.major >= 3:
+    import urllib.request
+    import urllib.error
+    import urllib.parse
     import tkinter
+    import tkinter.messagebox
 else:
+    import urllib
     import urlparse
     import Tkinter
     import tkMessageBox