mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1791430 [Podofo ABI breakage in 0.9.6](https://bugs.launchpad.net/calibre/+bug/1791430)
This commit is contained in:
parent
d00b9e704a
commit
dc130d90cd
@ -39,7 +39,11 @@ PDFDoc_load(PDFDoc *self, PyObject *args) {
|
||||
|
||||
if (PyArg_ParseTuple(args, "s#", &buffer, &size)) {
|
||||
try {
|
||||
#if PODOFO_VERSION <= 0x000905
|
||||
self->doc->Load(buffer, (long)size);
|
||||
#else
|
||||
self->doc->LoadBuffer(buffer, (long)size);
|
||||
#endif
|
||||
} catch(const PdfError & err) {
|
||||
podofo_set_exception(err);
|
||||
return NULL;
|
||||
@ -56,7 +60,11 @@ PDFDoc_open(PDFDoc *self, PyObject *args) {
|
||||
|
||||
if (PyArg_ParseTuple(args, "s", &fname)) {
|
||||
try {
|
||||
#if PODOFO_VERSION <= 0x000905
|
||||
self->doc->Load(fname);
|
||||
#else
|
||||
self->doc->LoadFromFile(fname);
|
||||
#endif
|
||||
} catch(const PdfError & err) {
|
||||
podofo_set_exception(err);
|
||||
return NULL;
|
||||
@ -633,4 +641,3 @@ PyTypeObject pdf::PDFDocType = {
|
||||
|
||||
};
|
||||
// }}}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user