Skip to content

Commit

Permalink
Fix import error on Python 3.5.0 and 3.5.1
Browse files Browse the repository at this point in the history
While `typing` was added in 3.5.0, `typing.Text` was only added in
3.5.2, and so causes an `AttributeError`, not an `ImportError`
  exception.
  • Loading branch information
gongqingkui authored and bbc2 committed Jul 16, 2020
1 parent 4b43436 commit 024496b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
### Fixed

- Fix potentially empty expanded value for duplicate key (#260 by [@bbc]).
- Fix import error on Python 3.5.0 and 3.5.1 (#262 by [@gongqingkui]).

## [0.14.0] - 2020-07-03

Expand Down Expand Up @@ -206,6 +207,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
[@ekohl]: https://github.com/ekohl
[@elbehery95]: https://github.com/elbehery95
[@gergelyk]: https://github.com/gergelyk
[@gongqingkui]: https://github.com/gongqingkui
[@greyli]: https://github.com/greyli
[@qnighy]: https://github.com/qnighy
[@snobu]: https://github.com/snobu
Expand Down
2 changes: 1 addition & 1 deletion src/dotenv/parser.py
Expand Up @@ -55,7 +55,7 @@ def make_regex(string, extra_flags=0):
("error", bool),
],
)
except ImportError:
except (ImportError, AttributeError):
from collections import namedtuple
Original = namedtuple( # type: ignore
"Original",
Expand Down

0 comments on commit 024496b

Please sign in to comment.