mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-20 13:15:14 +02:00
refactor: replace os.path.commonprefix with os.path.commonpath for path comparisons
This commit is contained in:
5 files changed
+13
-8
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user