From e7d6be99336f0d6f9908ecdc228c9ee9fedd0335 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= Date: Mon, 1 Aug 2016 11:27:32 +0300 Subject: Fixed positional weekday position expressions failing on Python 3 --- apscheduler/triggers/cron/expressions.py | 2 +- docs/versionhistory.rst | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apscheduler/triggers/cron/expressions.py b/apscheduler/triggers/cron/expressions.py index bbcd682..9eeaa95 100644 --- a/apscheduler/triggers/cron/expressions.py +++ b/apscheduler/triggers/cron/expressions.py @@ -165,7 +165,7 @@ class WeekdayPositionExpression(AllExpression): if self.option_num < 5: target_day = first_hit_day + self.option_num * 7 else: - target_day = first_hit_day + ((last_day - first_hit_day) / 7) * 7 + target_day = first_hit_day + ((last_day - first_hit_day) // 7) * 7 if target_day <= last_day and target_day >= date.day: return target_day diff --git a/docs/versionhistory.rst b/docs/versionhistory.rst index 71ccf34..417ad55 100644 --- a/docs/versionhistory.rst +++ b/docs/versionhistory.rst @@ -12,6 +12,8 @@ APScheduler, see the :doc:`migration section `. * Improved import logic in ``ref_to_obj()`` to avoid errors in cases where traversing the path with ``getattr()`` would not work (thanks to Jarek Glowacki for the patch) +* Fixed positional weekday position expressions failing on Python 3 + 3.2.0 ----- -- cgit v1.2.1