mirror of
https://git.launchpad.net/~ubuntu-release/britney/+git/britney2-ubuntu
synced 2025-02-24 03:41:12 +00:00
AgePolicy: Explicitly ignore comment lines in data files
Currently not useful, but it enables us to write comment lines in the test data files. Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
parent
b0f0dde8f5
commit
e88f4d2e5e
@ -312,7 +312,10 @@ class AgePolicy(BasePolicy):
|
||||
try:
|
||||
with open(filename, encoding='utf-8') as fd:
|
||||
for line in fd:
|
||||
# <source> <version> <date>
|
||||
if line.startswith('#'):
|
||||
# Ignore comment lines (mostly used for tests)
|
||||
continue
|
||||
# <source> <version> <date>)
|
||||
l = line.split()
|
||||
if len(l) != 3:
|
||||
continue
|
||||
@ -344,6 +347,9 @@ class AgePolicy(BasePolicy):
|
||||
|
||||
with open(filename, errors='surrogateescape', encoding='ascii') as fd:
|
||||
for line in fd:
|
||||
if line.startswith('#'):
|
||||
# Ignore comment lines (mostly used for tests)
|
||||
continue
|
||||
# <source> <version> <urgency>
|
||||
l = line.split()
|
||||
if len(l) != 3:
|
||||
|
Loading…
x
Reference in New Issue
Block a user