aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-22 14:04:13 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-10-22 14:04:13 +0200
commit67ea3c20c2eef01640d582e9fd2b02a8ec925a64 (patch)
tree901b82253b241e63958bdd26ce0137c9712c0d27
parent8124c3e12d185ed5ab0ffe269e917ec911e76a9d (diff)
downloadusbutils-67ea3c20c2eef01640d582e9fd2b02a8ec925a64.tar.gz
lsusb.py: strip whitespace from device strings
Some devices have a bunch of whitespace in the string for no good reason. Strip that off to make things look better. The diff of an output from before/after for a device I have looks like: - 3-2 2109:2812 09 1IF [USB 2.10, 480 Mbps, 0mA] (VIA Labs, Inc. USB2.0 Hub ) hub + 3-2 2109:2812 09 1IF [USB 2.10, 480 Mbps, 0mA] (VIA Labs, Inc. USB2.0 Hub) hub Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--lsusb.py.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/lsusb.py.in b/lsusb.py.in
index 94c55e7..a43fab0 100644
--- a/lsusb.py.in
+++ b/lsusb.py.in
@@ -225,7 +225,7 @@ def find_dev(driver, usbname):
class UsbObject:
def read_attr(self, name):
path = prefix + self.path + "/" + name
- return open(path).readline().rstrip("\n")
+ return open(path).readline().strip()
def read_link(self, name):
path = prefix + self.path + "/" + name