Skip to content

Commit a3515d0

Browse files
jpmckinneyjarofgreen
authored andcommitted
fix: Import backports-datetime-fromisoformat only if needed, to fix PyPy 3.7 support
#415
1 parent a9c4b71 commit a3515d0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66

77
## [Unreleased]
88

9+
### Fixed
10+
11+
- Import backports-datetime-fromisoformat only if needed, to fix PyPy 3.7 support
12+
913
## [0.20.0] - 2022-12-07
1014

1115
### Changed

flattentool/ODSReader.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@
1818
from collections import OrderedDict
1919
from datetime import datetime
2020

21-
import backports.datetime_fromisoformat
2221
import odf.opendocument
2322
from odf.table import Table, TableCell, TableRow
2423

2524
# Backport for datetime.fromisoformat, which is new in Python 3.7
2625
try:
2726
_ = datetime.fromisoformat
2827
except AttributeError:
28+
import backports.datetime_fromisoformat
29+
2930
backports.datetime_fromisoformat.MonkeyPatch.patch_fromisoformat()
3031

3132

0 commit comments

Comments
 (0)