Change get backend method for Lattice and run tests

pull/254/head
Vinayak Mehta 2021-07-11 23:12:20 +05:30
parent 8abd69fc24
commit 1afe429034
No known key found for this signature in database
GPG Key ID: 2DE013537A15A9A4
1 changed files with 10 additions and 10 deletions

View File

@ -140,7 +140,11 @@ class Lattice(BaseParser):
return "convert" in methods
if isinstance(backend, str):
if backend in BACKENDS.keys():
if backend not in BACKENDS.keys():
raise NotImplementedError(
f"Unknown backend '{backend}' specified. Please use either 'poppler' or 'ghostscript'."
)
if backend == "ghostscript":
warnings.warn(
"'ghostscript' will be replaced by 'poppler' as the default image conversion"
@ -149,10 +153,6 @@ class Lattice(BaseParser):
)
return BACKENDS[backend]()
else:
raise NotImplementedError(
f"Unknown backend '{backend}' specified. Please use either 'poppler' or 'ghostscript'."
)
else:
if not implements_convert():
raise NotImplementedError(