Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: Build wheels
uses: pypa/cibuildwheel@v2.10.1
env:
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.7"
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8"
with:
package-dir: .
output-dir: dist
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
strategy:
matrix:
os: [Ubuntu, MacOS, Windows]
python-version: [3.7, 3.8, 3.9, "3.10", "3.11", "3.12"]
python-version: [3.8, 3.9, "3.10", "3.11", "3.12"]
defaults:
run:
shell: bash
Expand Down
20 changes: 8 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@ Pendulum
.. image:: https://img.shields.io/pypi/l/pendulum.svg
:target: https://pypi.python.org/pypi/pendulum

.. image:: https://img.shields.io/codecov/c/github/sdispater/pendulum/master.svg
:target: https://codecov.io/gh/sdispater/pendulum/branch/master

.. image:: https://github.com/sdispater/pendulum/actions/workflows/tests.yml/badge.svg
:alt: Pendulum Build status
:target: https://github.com/sdispater/pendulum/actions


Python datetimes made easy.

Supports Python **2.7** and **3.4+**.
Supports Python **3.8 and newer**.


.. code-block:: python
Expand Down Expand Up @@ -56,6 +53,13 @@ Supports Python **2.7** and **3.4+**.
'2013-03-31T03:00:00+02:00'


Resources
=========

* `Official Website <https://pendulum.eustace.io>`_
* `Documentation <https://pendulum.eustace.io/docs/>`_
* `Issue Tracker <https://github.com/sdispater/pendulum/issues>`_

Why Pendulum?
=============

Expand Down Expand Up @@ -121,14 +125,6 @@ a possible solution, if any:
return '' if val is None else val.isoformat()


Resources
=========

* `Official Website <https://pendulum.eustace.io>`_
* `Documentation <https://pendulum.eustace.io/docs/>`_
* `Issue Tracker <https://github.com/sdispater/pendulum/issues>`_


Contributing
============

Expand Down
11 changes: 3 additions & 8 deletions pendulum/datetime.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import calendar
import datetime
import sys
import traceback

from typing import TYPE_CHECKING
Expand Down Expand Up @@ -1243,13 +1242,9 @@ def __add__(self, other: datetime.timedelta) -> Self:
if not isinstance(other, datetime.timedelta):
return NotImplemented

if sys.version_info >= (3, 8):
# This is a workaround for Python 3.8+
# since calling astimezone() will call this method
# instead of the base datetime class one.
caller = traceback.extract_stack(limit=2)[0].name
if caller == "astimezone":
return super().__add__(other)
caller = traceback.extract_stack(limit=2)[0].name
if caller == "astimezone":
return super().__add__(other)

return self._add_timedelta_(other)

Expand Down
Loading