refactor: replace os.path.commonprefix with os.path.commonpath for path comparisons

This commit is contained in:
grossmj committed 2026-10-31 19:43:52 +07:00
1 parent be368dd222
commit 110638d81a
5 files changed
+13 -8

No files matched your search

+2 -1
View File
@@ -22,6 +22,7 @@ import logging
import os
import re
import uuid
from os.path import commonpath
from ..config import Config
from ..utils import int_to_macaddress, macaddress_to_int
@@ -420,7 +421,7 @@ class Node:
try:
if not val.startswith(":") and os.path.isabs(val):
default_symbol_directory = Config.instance().settings.Server.symbols_path
if os.path.commonprefix([default_symbol_directory, val]) != default_symbol_directory:
if commonpath([default_symbol_directory, val]) != default_symbol_directory:
val = os.path.basename(val)
except OSError:
pass