mirror of
https://github.com/MiSTer-devel/Distribution_MiSTer.git
synced 2026-05-17 03:03:37 +00:00
Fixing is_valid_path
This commit is contained in:
committed by
GitHub
parent
a0389fb98f
commit
55df82dd89
5
.github/db_operator.py
vendored
5
.github/db_operator.py
vendored
@@ -202,7 +202,7 @@ def is_valid_url(url: str) -> bool:
|
||||
def is_valid_path(path: str) -> bool:
|
||||
try:
|
||||
p = Path(path)
|
||||
if not p.is_relative() or len(path) < 3:
|
||||
if p.is_absolute() or len(path) < 3:
|
||||
return False
|
||||
|
||||
for part in p.parts:
|
||||
@@ -210,7 +210,8 @@ def is_valid_path(path: str) -> bool:
|
||||
return False
|
||||
|
||||
return True
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return False
|
||||
|
||||
def is_valid_size(size: str) -> bool:
|
||||
|
||||
Reference in New Issue
Block a user