Skip to content

Commit

Permalink
[FIX] report_py3o: adapt for python > 3.10
Browse files Browse the repository at this point in the history
standard odoo now installs PyPDF2==2.12.1 if python used is 3.10. And
it no longer has module PyPDF2.pdf.
  • Loading branch information
oerp-odoo committed Jul 12, 2024
1 parent 9906460 commit ee1ba5d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion report_py3o/tests/test_report_py3o.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

import pkg_resources
from PyPDF2 import PdfFileWriter
from PyPDF2.pdf import PageObject
try:
from PyPDF2.pdf import PageObject
# If python > 3.10, odoo installs PyPDF2==2.12.1 and it no longer has
# PyPDF2.pdf module.
except ModuleNotFoundError:
from PyPDF2 import PageObject

from odoo import tools
from odoo.exceptions import ValidationError
Expand Down

0 comments on commit ee1ba5d

Please sign in to comment.