mirror of
https://github.com/pi-hole/FTL.git
synced 2026-07-06 23:45:10 +01:00
macvendor.py: use raw strings for regex
This prevents the following warning message:
[...]/tools/macvendor.py:67: SyntaxWarning: "\s" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\s"? A raw string is also an option.
cols = re.split("\s\s+|\t", line)
Signed-off-by: darkexplosiveqwx <101737077+darkexplosiveqwx@users.noreply.github.com>
This commit is contained in:
+2
-2
@@ -62,9 +62,9 @@ for line in manuf:
|
||||
continue
|
||||
|
||||
# Remove quotation marks as these might interfere with later INSERT / UPDATE commands
|
||||
line = re.sub("\'|\"","", line)
|
||||
line = re.sub(r"\'|\"","", line)
|
||||
# \s = Unicode whitespace characters, including [ \t\n\r\f\v]
|
||||
cols = re.split("\s\s+|\t", line)
|
||||
cols = re.split(r"\s\s+|\t", line)
|
||||
# Use try/except chain to catch empty/incomplete lines without failing hard
|
||||
try:
|
||||
# Strip whitespace and quotation marks (some entries are incomplete and cause errors with the CSV parser otherwise)
|
||||
|
||||
Reference in New Issue
Block a user