Skip to content

Commit 5939924

Browse files
committed
Fix an "AttributeError: 'dict' object has no attribute 'name'" when fetching portable Python
1 parent 1ba3468 commit 5939924

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pioinstaller/python.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,13 @@ def get_portable_python_url():
103103
for version in result["versions"]
104104
if is_version_system_compatible(version, systype)
105105
]
106-
best_version = None
106+
best_version = {}
107107
for version in versions:
108108
if not best_version or semantic_version.Version(
109-
version.name
110-
) > semantic_version.Version(best_version.name):
109+
version["name"]
110+
) > semantic_version.Version(best_version["name"]):
111111
best_version = version
112-
for item in (best_version or {}).get("files", []):
112+
for item in best_version.get("files", []):
113113
if systype in item["system"]:
114114
return item["download_url"]
115115
return None

0 commit comments

Comments
 (0)