diff --git a/serial/serialposix.py b/serial/serialposix.py
index c920cbe..ae113c2 100644
--- a/serial/serialposix.py
+++ b/serial/serialposix.py
@@ -35,15 +35,15 @@
 ! Use an explicit path (eg /dev/ttyS1) or send this information to
 ! the author of this module:
 
-sys.platform = %r
-os.name = %r
-serialposix.py version = %s
+sys.platform = {!r}
+os.name = {!r}
+serialposix.py version = {}
 
 also add the device name of the serial port and where the
 counting starts for the first serial port.
 e.g. 'first serial port: /dev/ttyS0'
 and with a bit luck you can get this module running...
-""" % (sys.platform, os.name, serial.VERSION))
+""".format(sys.platform, os.name, serial.VERSION))
         raise NotImplementedError('no number-to-device mapping defined on this platform')
 
     def _set_special_baudrate(self, baudrate):
@@ -125,7 +125,7 @@
                 # set serial_struct
                 fcntl.ioctl(self.fd, TCSETS2, buf)
             except IOError as e:
-                raise ValueError('Failed to set custom baud rate (%s): %s' % (baudrate, e))
+                raise ValueError('Failed to set custom baud rate ({}): {}'.format(baudrate, e))
 
         def _set_rs485_mode(self, rs485_settings):
             buf = array.array('i', [0] * 8)  # flags, delaytx, delayrx, padding
@@ -150,7 +150,7 @@
                     buf[0] = 0  # clear SER_RS485_ENABLED
                 fcntl.ioctl(self.fd, TIOCSRS485, buf)
             except IOError as e:
-                raise ValueError('Failed to set RS485 mode: %s' % (e,))
+                raise ValueError('Failed to set RS485 mode: {}'.format(e))
 
 
 elif plat == 'cygwin':       # cygwin/win32 (confirmed)
@@ -292,7 +292,7 @@
             self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
         except OSError as msg:
             self.fd = None
-            raise SerialException(msg.errno, "could not open port %s: %s" % (self._port, msg))
+            raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
         #~ fcntl.fcntl(self.fd, fcntl.F_SETFL, 0)  # set blocking
 
         try:
@@ -328,7 +328,7 @@
             orig_attr = termios.tcgetattr(self.fd)
             iflag, oflag, cflag, lflag, ispeed, ospeed, cc = orig_attr
         except termios.error as msg:      # if a port is nonexistent but has a /dev file, it'll fail here
-            raise SerialException("Could not configure port: %s" % msg)
+            raise SerialException("Could not configure port: {}".format(msg))
         # set up raw mode / no echo / binary
         cflag |= (termios.CLOCAL | termios.CREAD)
         lflag &= ~(termios.ICANON | termios.ECHO | termios.ECHOE |
@@ -347,7 +347,7 @@
 
         # setup baud rate
         try:
-            ispeed = ospeed = getattr(termios, 'B%s' % (self._baudrate))
+            ispeed = ospeed = getattr(termios, 'B{}'.format(self._baudrate))
         except AttributeError:
             try:
                 ispeed = ospeed = self.BAUDRATE_CONSTANTS[self._baudrate]
@@ -358,10 +358,10 @@
                 try:
                     custom_baud = int(self._baudrate)  # store for later
                 except ValueError:
-                    raise ValueError('Invalid baud rate: %r' % self._baudrate)
+                    raise ValueError('Invalid baud rate: {!r}'.format(self._baudrate))
                 else:
                     if custom_baud < 0:
-                        raise ValueError('Invalid baud rate: %r' % self._baudrate)
+                        raise ValueError('Invalid baud rate: {!r}'.format(self._baudrate))
 
         # setup char len
         cflag &= ~termios.CSIZE
@@ -374,7 +374,7 @@
         elif self._bytesize == 5:
             cflag |= termios.CS5
         else:
-            raise ValueError('Invalid char len: %r' % self._bytesize)
+            raise ValueError('Invalid char len: {!r}'.format(self._bytesize))
         # setup stop bits
         if self._stopbits == serial.STOPBITS_ONE:
             cflag &= ~(termios.CSTOPB)
@@ -383,7 +383,7 @@
         elif self._stopbits == serial.STOPBITS_TWO:
             cflag |= (termios.CSTOPB)
         else:
-            raise ValueError('Invalid stop bit specification: %r' % self._stopbits)
+            raise ValueError('Invalid stop bit specification: {!r}'.format(self._stopbits))
         # setup parity
         iflag &= ~(termios.INPCK | termios.ISTRIP)
         if self._parity == serial.PARITY_NONE:
@@ -399,7 +399,7 @@
             cflag |= (termios.PARENB | CMSPAR)
             cflag &= ~(termios.PARODD)
         else:
-            raise ValueError('Invalid parity: %r' % self._parity)
+            raise ValueError('Invalid parity: {!r}'.format(self._parity))
         # setup flow control
         # xonxoff
         if hasattr(termios, 'IXANY'):
@@ -428,11 +428,11 @@
         # buffer
         # vmin "minimal number of characters to be read. 0 for non blocking"
         if vmin < 0 or vmin > 255:
-            raise ValueError('Invalid vmin: %r ' % vmin)
+            raise ValueError('Invalid vmin: {!r}'.format(vmin))
         cc[termios.VMIN] = vmin
         # vtime
         if vtime < 0 or vtime > 255:
-            raise ValueError('Invalid vtime: %r' % vtime)
+            raise ValueError('Invalid vtime: {!r}'.format(vtime))
         cc[termios.VTIME] = vtime
         # activate settings
         if force_update or [iflag, oflag, cflag, lflag, ispeed, ospeed, cc] != orig_attr:
@@ -505,13 +505,13 @@
                 # this is for Python 3.x where select.error is a subclass of
                 # OSError ignore EAGAIN errors. all other errors are shown
                 if e.errno != errno.EAGAIN:
-                    raise SerialException('read failed: %s' % (e,))
+                    raise SerialException('read failed: {}'.format(e))
             except select.error as e:
                 # this is for Python 2.x
                 # ignore EAGAIN errors. all other errors are shown
                 # see also http://www.python.org/dev/peps/pep-3151/#select
                 if e[0] != errno.EAGAIN:
-                    raise SerialException('read failed: %s' % (e,))
+                    raise SerialException('read failed: {}'.format(e))
         return bytes(read)
 
     def write(self, data):
@@ -547,7 +547,7 @@
                 raise
             except OSError as v:
                 if v.errno != errno.EAGAIN:
-                    raise SerialException('write failed: %s' % (v,))
+                    raise SerialException('write failed: {}'.format(v))
                 # still calculate and check timeout
                 if timeout and timeout - time.time() < 0:
                     raise writeTimeoutError
@@ -753,10 +753,10 @@
             orig_attr = termios.tcgetattr(self.fd)
             iflag, oflag, cflag, lflag, ispeed, ospeed, cc = orig_attr
         except termios.error as msg:      # if a port is nonexistent but has a /dev file, it'll fail here
-            raise serial.SerialException("Could not configure port: %s" % msg)
+            raise serial.SerialException("Could not configure port: {}".format(msg))
 
         if vtime < 0 or vtime > 255:
-            raise ValueError('Invalid vtime: %r' % vtime)
+            raise ValueError('Invalid vtime: {!r}'.format(vtime))
         cc[termios.VTIME] = vtime
         cc[termios.VMIN] = vmin
 
