Skip to content

Commit 78be0f8

Browse files
gongqingkuibbc2
authored andcommitted
Fix import error on Python 3.5.0 and 3.5.1
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.
1 parent 4b43436 commit 78be0f8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
1010
### Fixed
1111

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

1415
## [0.14.0] - 2020-07-03
1516

@@ -206,6 +207,7 @@ project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
206207
[@ekohl]: https://github.com/ekohl
207208
[@elbehery95]: https://github.com/elbehery95
208209
[@gergelyk]: https://github.com/gergelyk
210+
[@gongqingkui]: https://github.com/gongqingkui
209211
[@greyli]: https://github.com/greyli
210212
[@qnighy]: https://github.com/qnighy
211213
[@snobu]: https://github.com/snobu

src/dotenv/parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def make_regex(string, extra_flags=0):
5555
("error", bool),
5656
],
5757
)
58-
except ImportError:
58+
except (ImportError, AttributeError):
5959
from collections import namedtuple
6060
Original = namedtuple( # type: ignore
6161
"Original",

0 commit comments

Comments
 (0)