Use with
This commit is contained in:
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:
|
||||
|
||||
Reference in new issue
Block a user