mirror of
https://github.com/akuker/RASCSI.git
synced 2024-12-27 16:31:36 +00:00
Merge pull request #804 from nucleogenic/fix-python-3.7-compat
Fix Python 3.7 compatibility (#800)
This commit is contained in:
commit
72c9f1c6ab
@ -79,7 +79,8 @@ def extract_archive(file_path, **kwargs):
|
||||
extracted_members = []
|
||||
|
||||
for line in lines[1:-1]:
|
||||
if line_matches := match(unar_file_extracted, line):
|
||||
line_matches = match(unar_file_extracted, line)
|
||||
if line_matches:
|
||||
matches = line_matches.groupdict()
|
||||
member = {
|
||||
"name": str(pathlib.PurePath(matches["path"]).name),
|
||||
@ -90,7 +91,11 @@ def extract_archive(file_path, **kwargs):
|
||||
"absolute_path": str(pathlib.PurePath(tmp_dir).joinpath(matches["path"])),
|
||||
}
|
||||
|
||||
member_types = matches.get("types", "").removeprefix(", ").split(", ")
|
||||
member_types = matches.get("types", "")
|
||||
if member_types.startswith(", "):
|
||||
member_types = member_types[2:].split(", ")
|
||||
else:
|
||||
member_types = member_types.split(", ")
|
||||
|
||||
if "dir" in member_types:
|
||||
member["is_dir"] = True
|
||||
|
Loading…
Reference in New Issue
Block a user