mirror of
https://github.com/lutris/lutris
synced 2024-10-14 03:32:52 +00:00
fix RecursionError, when opening game settings (closes #2650)
This commit is contained in:
parent
10ec196653
commit
fd5b697573
|
@ -150,7 +150,7 @@ class FileChooserEntry(Gtk.Box):
|
|||
)
|
||||
self.pack_end(non_empty_label, False, False, 10)
|
||||
parent = system.get_existing_parent(path)
|
||||
if not os.access(parent, os.W_OK):
|
||||
if parent is not None and not os.access(parent, os.W_OK):
|
||||
non_writable_destination_label = Gtk.Label(visible=True)
|
||||
non_writable_destination_label.set_markup(
|
||||
"<b>Warning</b> The destination folder "
|
||||
|
|
|
@ -343,7 +343,10 @@ def run_once(function):
|
|||
|
||||
def get_existing_parent(path):
|
||||
"""Return the 1st existing parent for a folder (or itself if the path
|
||||
exists and is a directory)"""
|
||||
exists and is a directory). returns None, when none of the parents exists.
|
||||
"""
|
||||
if path == "":
|
||||
return None
|
||||
if os.path.exists(path) and not os.path.isfile(path):
|
||||
return path
|
||||
return get_existing_parent(os.path.dirname(path))
|
||||
|
|
Loading…
Reference in a new issue