Skip to content

Commit 6ec9485

Browse files
[3.14] gh-143959: Make _datetime optional for test_sys (GH-144003) (#144143)
gh-143959: Make _datetime optional for test_sys (GH-144003) (cherry picked from commit c447d1b) Co-authored-by: Jeong, YunWon <69878+youknowone@users.noreply.github.com>
1 parent 9d02150 commit 6ec9485

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Lib/test/test_sys.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import builtins
22
import codecs
3-
import _datetime
43
import gc
54
import io
65
import locale
@@ -1729,7 +1728,12 @@ def delx(self): del self.__x
17291728
x = property(getx, setx, delx, "")
17301729
check(x, size('5Pi'))
17311730
# PyCapsule
1732-
check(_datetime.datetime_CAPI, size('6P'))
1731+
try:
1732+
import _datetime
1733+
except ModuleNotFoundError:
1734+
pass
1735+
else:
1736+
check(_datetime.datetime_CAPI, size('6P'))
17331737
# rangeiterator
17341738
check(iter(range(1)), size('3l'))
17351739
check(iter(range(2**65)), size('3P'))

0 commit comments

Comments
 (0)