aerkalov / ebooklib

Python E-book library for handling books in EPUB2/EPUB3 format -
https://ebooklib.readthedocs.io/
GNU Affero General Public License v3.0
1.47k stars 229 forks source link

Change deprecation check #283

Closed tjkuson closed 2 months ago

tjkuson commented 1 year ago

Check for None rather than falsey-ness.

The current problem is that

book = epub.read_epub('test.epub', options={'ignore_ncx': False})

will raise a user warning because the current logic checks for Falsey-ness rather than None. The expected behaviour is that no warning should be raised as the option was passed explicitly (the warning about the default value doesn't matter). This pull request changes the deprecation check to check for None rather than falsey-ness.

aerkalov commented 2 months ago

Thanks for this!