Commit b1089f62 authored by Seblu's avatar Seblu

Use raw strings with regexp

parent 9a6c38e9
......@@ -124,7 +124,7 @@ class Package(Url):
self.filename = basename(url)
self.sigfilename = self.filename + SIG_EXT
# regex is not strict, but we are not validating something here
m = match("^([\w@._+-]+)-((?:(\d+):)?([^-]+)-([^-]+))-(\w+)", self.filename)
m = match(r"^([\w@._+-]+)-((?:(\d+):)?([^-]+)-([^-]+))-(\w+)", self.filename)
if m is None:
raise Error("Unable to parse package info from filename %s" % self.filename)
(, self.full_version, self.epoch, self.version, self.release,
......@@ -288,7 +288,7 @@ def select_packages(packages, select_all=False):
for i, pkg in index.items():
print("{:{pad}} {}".format(i, pkg, pad=pad))
selection = ""
while not match("^(\d+ ){0,}\d+$", selection):
while not match(r"^(\d+ ){0,}\d+$", selection):
selection = input("Select packages (* for all): ").strip()
except EOFError:
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment