diff options
author | Alex Grönholm <alex.gronholm@nextday.fi> | 2015-12-11 00:52:44 +0200 |
---|---|---|
committer | Alex Grönholm <alex.gronholm@nextday.fi> | 2015-12-11 01:03:12 +0200 |
commit | c294a8cc06b928032d28bb5584c7f03ec3f2e8e1 (patch) | |
tree | 70a1c7eb1661339e85962dd425c8fa97bf8eed18 | |
parent | 9dc2fc82bf7933a4cd59bb856d3799732b781cf6 (diff) | |
download | apscheduler-c294a8cc06b928032d28bb5584c7f03ec3f2e8e1.tar.gz |
Fixed the asyncio scheduler example on Python < 3.3
-rw-r--r-- | examples/schedulers/asyncio_.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/schedulers/asyncio_.py b/examples/schedulers/asyncio_.py index a5d6373..37b8675 100644 --- a/examples/schedulers/asyncio_.py +++ b/examples/schedulers/asyncio_.py @@ -3,11 +3,15 @@ Demonstrates how to use the Tornado compatible scheduler to schedule a job that """ from datetime import datetime -import asyncio import os from apscheduler.schedulers.asyncio import AsyncIOScheduler +try: + import asyncio +except ImportError: + import trollius as asyncio + def tick(): print('Tick! The time is: %s' % datetime.now()) |