Skip to content

Commit

Permalink
Merge pull request #135 from tcalmant/deprecation-handling
Browse files Browse the repository at this point in the history
Handle deprecation warnings
  • Loading branch information
tcalmant authored Aug 22, 2024
2 parents 688f820 + 6ea1775 commit adfc4b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
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

0 comments on commit adfc4b8

Please sign in to comment.