mirror of
https://github.com/ansible-collections/hetzner.hcloud.git
synced 2026-02-04 08:01:49 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
51cafbcd57
commit
ff5e435d5b
1 changed files with 4 additions and 8 deletions
|
|
@ -34,28 +34,24 @@ def apply_code_modifications(source_path: Path):
|
|||
# Wrap requests imports
|
||||
content = re.sub(
|
||||
r"import requests",
|
||||
dedent(
|
||||
r"""
|
||||
dedent(r"""
|
||||
try:
|
||||
import requests
|
||||
except ImportError:
|
||||
requests = None
|
||||
"""
|
||||
).strip(),
|
||||
""").strip(),
|
||||
content,
|
||||
)
|
||||
|
||||
# Wrap dateutil imports
|
||||
content = re.sub(
|
||||
r"from dateutil.parser import isoparse",
|
||||
dedent(
|
||||
r"""
|
||||
dedent(r"""
|
||||
try:
|
||||
from dateutil.parser import isoparse
|
||||
except ImportError:
|
||||
isoparse = None
|
||||
"""
|
||||
).strip(),
|
||||
""").strip(),
|
||||
content,
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue