Change get backend method for Lattice and run tests

This commit is contained in:
Vinayak Mehta
2021-07-11 23:12:20 +05:30
parent 8abd69fc24
commit 1afe429034
+10 -10
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(