diff options
| author | Christian Heimes <christian@python.org> | 2021-11-01 10:14:53 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-01 10:14:53 (GMT) |
| commit | e73283a20fb05b70da2990decefac0e011faec17 (patch) | |
| tree | a490f99e1eab3e779b5828b8f51994e91b4aa2b6 /Lib/test/datetimetester.py | |
| parent | 762a4dc9361f9563e158e373ba8d767b4449f23d (diff) | |
| download | cpython-e73283a20fb05b70da2990decefac0e011faec17.zip cpython-e73283a20fb05b70da2990decefac0e011faec17.tar.gz cpython-e73283a20fb05b70da2990decefac0e011faec17.tar.bz2 | |
bpo-45668: Fix PGO tests without test extensions (GH-29315)
Diffstat (limited to 'Lib/test/datetimetester.py')
| -rw-r--r-- | Lib/test/datetimetester.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py index 9f551d9..810478c 100644 --- a/Lib/test/datetimetester.py +++ b/Lib/test/datetimetester.py @@ -31,7 +31,10 @@ from datetime import timezone from datetime import date, datetime import time as _time -import _testcapi +try: + import _testcapi +except ImportError: + _testcapi = None # Needed by test_datetime import _strptime @@ -5918,6 +5921,7 @@ class IranTest(ZoneInfoTest): zonename = 'Asia/Tehran' +@unittest.skipIf(_testcapi is None, 'need _testcapi module') class CapiTest(unittest.TestCase): def setUp(self): # Since the C API is not present in the _Pure tests, skip all tests |
