Skip to content

Commit 23e8f56

Browse files
authored
Merge pull request #419 from itamarst/418.support-old-python-3.5
Make error message on Python 3.5.2 more useful
2 parents 5a9dabc + 7a7ea92 commit 23e8f56

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

docs/source/news.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ What's New
44
1.9.0
55
^^^^^
66

7+
Deprecation:
8+
9+
* 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.
10+
711
Features:
812

913
* If you call ``to_file()/FileDestination()`` with a non-writable file, an

eliot/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@
66

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

1119
dir(aiocontextvars) # pacify pyflakes

0 commit comments

Comments
 (0)