This commit is contained in:
Shawn Bruce authored and Gina Häußge committed 2021-07-15 17:48:22 +02:00
1 parent e82f4551f3
commit 7e23356add
1 file changed
+3 -3
@@ -314,9 +314,9 @@ class VirtualPrinterPlugin(
)
def uds_command(path):
if os.path.exists(path):
fd = os.open(path, os.O_PATH)
mode = os.fstat(fd).st_mode
os.close(fd)
with os.open(path, os.O_PATH) as fd:
mode = os.fstat(fd).st_mode
if stat.S_ISSOCK(mode):
os.unlink(path)
else: