Skip to content

Commit

Permalink
Fix tox regression I introduced in #90
Browse files Browse the repository at this point in the history
I didn't realize I should be running tox checks and it turns out
the type inference engine wasn't able to correctly infer
non-nullability previously. Introducing a variable fixes the check.
  • Loading branch information
bayesianmind committed Feb 13, 2021
1 parent d811ca0 commit 78e3ce0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions beancount_import/source/ultipro_google_statement.py
Expand Up @@ -297,8 +297,9 @@ def parse_hours(x: Optional[str]) -> Optional[Decimal]:
def parse_filename(path: str):
PDFTOTEXT_ENV='PDFTOTEXT_BINARY'
pdftotext='pdftotext'
if os.getenv(PDFTOTEXT_ENV):
pdftotext=os.getenv(PDFTOTEXT_ENV)
replacement_pdftotext = os.getenv(PDFTOTEXT_ENV)
if replacement_pdftotext is not None:
pdftotext=replacement_pdftotext
text = subprocess.check_output([pdftotext, '-raw', path, '-']).decode()
return parse(text)

Expand Down

0 comments on commit 78e3ce0

Please sign in to comment.