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,19 +140,19 @@ class Lattice(BaseParser):
return "convert" in methods
if isinstance(backend, str):
if backend in BACKENDS.keys():
if backend == "ghostscript":
warnings.warn(
"'ghostscript' will be replaced by 'poppler' as the default image conversion"
" backend in v0.12.0. You can try out 'poppler' with backend='poppler'.",
DeprecationWarning,
)
return BACKENDS[backend]()
else:
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"
" backend in v0.12.0. You can try out 'poppler' with backend='poppler'.",
DeprecationWarning,
)
return BACKENDS[backend]()
else:
if not implements_convert():
raise NotImplementedError(