Skip to content

Commit

Permalink
Merge pull request #419 from itamarst/418.support-old-python-3.5
Browse files Browse the repository at this point in the history
Make error message on Python 3.5.2 more useful
  • Loading branch information
itamarst authored May 20, 2019
2 parents 5a9dabc + 7a7ea92 commit 23e8f56
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/source/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ What's New
1.9.0
^^^^^

Deprecation:

* Python versions older than 3.5.3, e.g. the 3.5.2 on Ubuntu Xenial, don't work with Eliot, so added a more informative error message explaining that. Fixes #418.

Features:

* If you call ``to_file()/FileDestination()`` with a non-writable file, an
Expand Down
8 changes: 8 additions & 0 deletions eliot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@

# Enable asyncio contextvars support in Python 3.5/3.6:
if version_info < (3, 7):
# On Python 3.5.2 and earlier, some of the necessary attributes aren't exposed:
if version_info < (3, 5, 3):
raise RuntimeError(
"This version of Eliot doesn't work on Python 3.5.2 or earlier. "
"Either upgrade to Python 3.5.3 or later (on Ubuntu 16.04 "
"you can use https://launchpad.net/~deadsnakes/+archive/ubuntu/ppa "
"to get Python 3.6), or pin Eliot to version 1.7."
)
import aiocontextvars

dir(aiocontextvars) # pacify pyflakes
Expand Down

0 comments on commit 23e8f56

Please sign in to comment.