File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
33import datetime
4+ import os
45import typing as t
56
67import pendulum
1718 from pendulum .interval import Interval
1819 from pendulum .time import Time
1920
21+ with_extensions = os .getenv ("PENDULUM_EXTENSIONS" , "1" ) == "1"
22+
2023try :
24+ if not with_extensions :
25+ raise ImportError ()
26+
2127 from pendulum ._pendulum import Duration as RustDuration
2228except ImportError :
2329 RustDuration = None # type: ignore[assignment,misc]
Original file line number Diff line number Diff line change 44import copy
55import os
66import re
7- import struct
87
98from datetime import date
109from datetime import datetime
2120with_extensions = os .getenv ("PENDULUM_EXTENSIONS" , "1" ) == "1"
2221
2322try :
24- if not with_extensions or struct . calcsize ( "P" ) == 4 :
23+ if not with_extensions :
2524 raise ImportError ()
2625
2726 from pendulum ._pendulum import Duration
You can’t perform that action at this time.
0 commit comments