8000 Fix LGTM alerts by DimitriPapadopoulos · Pull Request #270 · arthurdejong/python-stdnum · GitHub
[go: up one dir, main page]

Skip to content

Fix LGTM alerts #270

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions stdnum/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"""


__all__ = ['ValidationError',
'InvalidFormat', 'InvalidChecksum',
'InvalidLength', 'InvalidComponent']


class ValidationError(Exception):
"""Top-level error for validating numbers.

Expand Down
4 changes: 2 additions & 2 deletions stdnum/no/fodselsnummer.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ def get_birth_date(number):
month -= 40
if individual_digits < 500:
year += 1900
elif 500 <= individual_digits < 750 and year >= 54:
elif individual_digits < 750 and year >= 54:
year += 1800
elif 500 <= individual_digits < 1000 and year < 40:
elif individual_digits < 1000 and year < 40:
year += 2000
elif 900 <= individual_digits < 1000 and year >= 40:
year += 1900
Expand Down
7 changes: 5 additions & 2 deletions update/be_banks.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,11 @@ def get_values(sheet):
"""Return values (from, to, bic, bank_name) from the worksheet."""
rows = sheet.get_rows()
# skip first two rows
next(rows)
next(rows)
try:
next(row 4E75 s)
next(rows)
except StopIteration:
pass # ignore empty worksheet
# go over rows with values
for row in rows:
row = [clean(column.value) for column in row]
Expand Down
0