summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-06-28 19:43:17 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-06-28 19:43:17 +0200
commit71e128041c83d9f26bcd7212088e6b50b0ec8319 (patch)
treed187d41258a06a54a4db1525b733846c8bd45b7e
parent00bcc7c2aa211aed0053dcc6a09aa6d2a476b9ab (diff)
support Python 3.7
-rwxr-xr-xbin/nvm7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/nvm b/bin/nvm
index c4c0a10..50b9138 100755
--- a/bin/nvm
+++ b/bin/nvm
@@ -95,14 +95,17 @@ class Line:
if self.product.startswith("national"):
self.css_class = "longdistance"
elif self.product == "tram":
- self.name = self.name.removeprefix("STR ")
+ # str.removeprefix requires Python ≥ 3.9
+ if self.name.startswith("STR "):
+ self.name = self.name[4:]
self.css_class = "tram"
elif self.product == "suburban":
self.css_class = "suburban"
elif self.product == "subway":
self.css_class = "subway"
elif self.product == "bus":
- self.name = self.name.removeprefix("Bus ")
+ if self.name.startswith("Bus "):
+ self.name = self.name[4:]
self.css_class = "bus"