Use absolute import everywhere
This prevents Python 2.7 from attempting to import system modules
like sys and ctypes from the 'serial' directory.
diff --git a/serial/urlhandler/protocol_alt.py b/serial/urlhandler/protocol_alt.py
index c14a87e..2e666ca 100644
--- a/serial/urlhandler/protocol_alt.py
+++ b/serial/urlhandler/protocol_alt.py
@@ -16,6 +16,8 @@
# use poll based implementation on Posix (Linux):
# python -m serial.tools.miniterm alt:///dev/ttyUSB0?class=PosixPollSerial
+from __future__ import absolute_import
+
try:
import urlparse
except ImportError:
diff --git a/serial/urlhandler/protocol_hwgrep.py b/serial/urlhandler/protocol_hwgrep.py
index 49bbebe..1a288c9 100644
--- a/serial/urlhandler/protocol_hwgrep.py
+++ b/serial/urlhandler/protocol_hwgrep.py
@@ -20,6 +20,8 @@
# n=<N> pick the N'th entry instead of the first one (numbering starts at 1)
# skip_busy tries to open port to check if it is busy, fails on posix as ports are not locked!
+from __future__ import absolute_import
+
import serial
import serial.tools.list_ports
diff --git a/serial/urlhandler/protocol_loop.py b/serial/urlhandler/protocol_loop.py
index 7bf6cf9..985e7a7 100644
--- a/serial/urlhandler/protocol_loop.py
+++ b/serial/urlhandler/protocol_loop.py
@@ -13,6 +13,8 @@
# URL format: loop://[option[/option...]]
# options:
# - "debug" print diagnostic messages
+from __future__ import absolute_import
+
import logging
import numbers
import time
diff --git a/serial/urlhandler/protocol_rfc2217.py b/serial/urlhandler/protocol_rfc2217.py
index 1898803..8be310f 100644
--- a/serial/urlhandler/protocol_rfc2217.py
+++ b/serial/urlhandler/protocol_rfc2217.py
@@ -7,4 +7,6 @@
#
# SPDX-License-Identifier: BSD-3-Clause
+from __future__ import absolute_import
+
from serial.rfc2217 import Serial # noqa
diff --git a/serial/urlhandler/protocol_socket.py b/serial/urlhandler/protocol_socket.py
index 5c77415..36cdf1f 100644
--- a/serial/urlhandler/protocol_socket.py
+++ b/serial/urlhandler/protocol_socket.py
@@ -16,6 +16,8 @@
# options:
# - "debug" print diagnostic messages
+from __future__ import absolute_import
+
import errno
import logging
import select
diff --git a/serial/urlhandler/protocol_spy.py b/serial/urlhandler/protocol_spy.py
index 3479010..92aaa2e 100644
--- a/serial/urlhandler/protocol_spy.py
+++ b/serial/urlhandler/protocol_spy.py
@@ -20,6 +20,8 @@
# redirect output to an other terminal window on Posix (Linux):
# python -m serial.tools.miniterm spy:///dev/ttyUSB0?dev=/dev/pts/14\&color
+from __future__ import absolute_import
+
import sys
import time