Skip to content

Commit 86d3382

Browse files
committed
Don't bomb on missing pdftotext
1 parent 787a818 commit 86d3382

File tree

1 file changed

+2
-0
lines changed
  • simple/management/commands/parse_government_bill_pdf

1 file changed

+2
-0
lines changed

simple/management/commands/parse_government_bill_pdf/pdftools.py

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ def local_or_system(toolname):
3636
PDFINFO=local_or_system('pdfinfo')
3737

3838
def pdftotext_version():
39+
if not PDFTOTEXT:
40+
return ('0', '0', '0')
3941
p = subprocess.Popen(executable=PDFTOTEXT, args=[PDFTOTEXT, '-v'], stderr=subprocess.PIPE, stdout=subprocess.PIPE)
4042
major, minor, patchlevel = map(lambda x,y:y if x is None else x,p.stderr.readlines()[0].strip().split()[-1].split('.'),[0]*3)
4143
p.kill()

0 commit comments

Comments
 (0)