Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle deprecation warnings #135

Merged
merged 3 commits into from
Aug 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pelix/rsa/edef.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ def _indent(self, element: ElementTree.Element, level: int = 0, prefix: str = "\
"""
element_prefix = "\n{0}".format(level * prefix)

if element:
if len(element) != 0:
if not element.text or not element.text.strip():
element.text = element_prefix + prefix

Expand Down
2 changes: 1 addition & 1 deletion pelix/shell/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def make_report(self, session: ShellSession, *levels: str) -> Optional[Dict[str,
"report.levels": levels,
"time.stamp": time.time(),
"time.local": str(datetime.datetime.now()),
"time.utc": str(datetime.datetime.utcnow()),
"time.utc": str(datetime.datetime.now(datetime.timezone.utc)),
}

return self.__report
Expand Down
6 changes: 5 additions & 1 deletion tests/rsa/test_py4j_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import os
import pathlib
import subprocess
import sys
import tarfile
import tempfile
import time
Expand Down Expand Up @@ -90,7 +91,10 @@ def safe_extract(

try:
os.chdir(folder)
tar.extractall(path, filtered_members, numeric_owner=numeric_owner)
if sys.version_info < (3, 12):
tar.extractall(path, filtered_members, numeric_owner=numeric_owner)
else:
tar.extractall(path, filtered_members, numeric_owner=numeric_owner, filter="data")
finally:
os.chdir(cur_dir)

Expand Down
Loading