Repository: incubator-airflow Updated Branches: refs/heads/master 7e7a745fd -> 02292c5d9
[AIRFLOW-2097] tz referenced before assignment UnboundLocalError: local variable 'tz' referenced before assignment Closes #3076 from feng-tao/airflow-2097 Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/02292c5d Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/02292c5d Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/02292c5d Branch: refs/heads/master Commit: 02292c5d9068d0fc199d861bdaafa674d5a19348 Parents: 7e7a745 Author: Tao feng <tf...@lyft.com> Authored: Wed Feb 28 10:11:52 2018 +0100 Committer: Fokko Driesprong <fokkodriespr...@godatadriven.com> Committed: Wed Feb 28 10:11:56 2018 +0100 ---------------------------------------------------------------------- airflow/utils/dates.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/02292c5d/airflow/utils/dates.py ---------------------------------------------------------------------- diff --git a/airflow/utils/dates.py b/airflow/utils/dates.py index aceb426..412327f 100644 --- a/airflow/utils/dates.py +++ b/airflow/utils/dates.py @@ -70,9 +70,9 @@ def date_range( end_date = timezone.utcnow() delta_iscron = False + tz = start_date.tzinfo if isinstance(delta, six.string_types): delta_iscron = True - tz = start_date.tzinfo start_date = timezone.make_naive(start_date, tz) cron = croniter(delta, start_date) elif isinstance(delta, timedelta):