diff options
author | Chris Liechti <cliechti@gmx.net> | 2016-06-08 03:35:28 +0200 |
---|---|---|
committer | Chris Liechti <cliechti@gmx.net> | 2016-06-08 03:35:28 +0200 |
commit | c8f3f82cbb314ceee12d27389466ce6f4af5ca72 (patch) | |
tree | e8f3bdd76f5adf748dbe4a57017a3740f00f36a4 /serial/tools/list_ports_linux.py | |
parent | 43b3b10b716dd78e0ebeab4ac29da0a50aa948f6 (diff) | |
download | pyserial-git-c8f3f82cbb314ceee12d27389466ce6f4af5ca72.tar.gz |
style: use .format() in various places instead of "%" formatting
Diffstat (limited to 'serial/tools/list_ports_linux.py')
-rw-r--r-- | serial/tools/list_ports_linux.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/serial/tools/list_ports_linux.py b/serial/tools/list_ports_linux.py index f957efe..567df6d 100644 --- a/serial/tools/list_ports_linux.py +++ b/serial/tools/list_ports_linux.py @@ -20,8 +20,8 @@ class SysFS(list_ports_common.ListPortInfo): super(SysFS, self).__init__(device) self.name = os.path.basename(device) self.usb_device_path = None - if os.path.exists('/sys/class/tty/%s/device' % (self.name,)): - self.device_path = os.path.realpath('/sys/class/tty/%s/device' % (self.name,)) + if os.path.exists('/sys/class/tty/{}/device'.format(self.name)): + self.device_path = os.path.realpath('/sys/class/tty/{}/device'.format(self.name)) self.subsystem = os.path.basename(os.path.realpath(os.path.join(self.device_path, 'subsystem'))) else: self.device_path = None @@ -81,4 +81,4 @@ def comports(): # test if __name__ == '__main__': for port, desc, hwid in sorted(comports()): - print("%s: %s [%s]" % (port, desc, hwid)) + print("{}: {} [{}]".format(port, desc, hwid)) |