[FIX] account: adapt pypdf2 import for both versions
As PyPDF2 was bumped from 1.2.6 to 2.12.1 and made some breaking changes, we made an attempt in 8e0564dff to have Odoo working with both versions. This is necessary because of the imminent release of Debian Bookworm that will provide PyPDF 2.12.1. In the meanwhile this import broke the Bookworm nightly build. While at it, let's remove the unused `textwrap` import. closes odoo/odoo#113667 X-original-commit: 7431019b35ee71813ce8602f46ddc50a70c661ed Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com> Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import textwrap
|
||||
from collections import OrderedDict
|
||||
from PyPDF2.utils import PdfStreamError
|
||||
|
||||
try:
|
||||
from PyPDF2.errors import PdfStreamError
|
||||
except ImportError:
|
||||
from PyPDF2.utils import PdfStreamError
|
||||
|
||||
from odoo import models, _
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
Reference in New Issue
Block a user