From 71e128041c83d9f26bcd7212088e6b50b0ec8319 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 28 Jun 2021 19:43:17 +0200 Subject: support Python 3.7 --- bin/nvm | 7 +++++-- 1 file 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" -- cgit v1.2.3