Skip to content

Fix case where transition can be None#350

Merged
sdispater merged 1 commit intopython-pendulum:masterfrom
jacebrowning:fix-nonetype-transition
Mar 6, 2020
Merged

Fix case where transition can be None#350
sdispater merged 1 commit intopython-pendulum:masterfrom
jacebrowning:fix-nonetype-transition

Conversation

@jacebrowning
Copy link
Copy Markdown
Contributor

When calling .subtract(days=days) with the maximum value ("now" - datetime.min), the following exception is raised:

>       if transition.is_ambiguous(sec):
E       AttributeError: 'NoneType' object has no attribute 'is_ambiguous'

@jacebrowning jacebrowning force-pushed the fix-nonetype-transition branch from ad1ac37 to b545b77 Compare March 3, 2019 02:36
@jacebrowning
Copy link
Copy Markdown
Contributor Author

@sdispater Please let me know if there is a cleaner way to solve this.

FYI: The InvalidPosixSpec test seems to be failing on master.

@sdispater sdispater merged commit 0753a3f into python-pendulum:master Mar 6, 2020
@sdispater
Copy link
Copy Markdown
Collaborator

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants