summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Grönholm <alex.gronholm@nextday.fi>2016-08-01 11:27:32 +0300
committerAlex Grönholm <alex.gronholm@nextday.fi>2016-08-01 11:27:32 +0300
commite7d6be99336f0d6f9908ecdc228c9ee9fedd0335 (patch)
treea561b69aeb2d73024a7b4168d5db12a349d9d010
parentb2300136719a0e2ce733095d381630823897568b (diff)
downloadapscheduler-e7d6be99336f0d6f9908ecdc228c9ee9fedd0335.tar.gz
Fixed positional weekday position expressions failing on Python 3
-rw-r--r--apscheduler/triggers/cron/expressions.py2
-rw-r--r--docs/versionhistory.rst2
2 files changed, 3 insertions, 1 deletions
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 <migration>`.
* 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
-----