move isoformat to compat, allow date, misc fixes
This commit is contained in:
parent
28fd9e4441
commit
8a8bec332e
5 changed files with 36 additions and 35 deletions
|
@ -2,6 +2,8 @@
|
|||
Some backwards compatibility stuff/deprecation helpers
|
||||
'''
|
||||
from types import ModuleType
|
||||
from typing import Callable
|
||||
from datetime import datetime
|
||||
|
||||
from . import warnings
|
||||
from .common import LazyLogger
|
||||
|
@ -10,6 +12,16 @@ from .common import LazyLogger
|
|||
logger = LazyLogger('my.core.compat')
|
||||
|
||||
|
||||
fromisoformat: Callable[[str], datetime]
|
||||
import sys
|
||||
if sys.version_info[:2] >= (3, 7):
|
||||
# prevent mypy on py3.6 from complaining...
|
||||
fromisoformat_real = datetime.fromisoformat
|
||||
fromisoformat = fromisoformat_real
|
||||
else:
|
||||
from .py37 import fromisoformat
|
||||
|
||||
|
||||
def pre_pip_dal_handler(
|
||||
name: str,
|
||||
e: ModuleNotFoundError,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue