File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 44"""
55
66__title__ = "osquery"
7- __version__ = "3.0.5 "
7+ __version__ = "3.0.6 "
88__author__ = "osquery developers"
99__license__ = "BSD"
1010__copyright__ = "Copyright 2015 Facebook"
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ def __init__(self, path=None):
7171 self .path = LINUX_BINARY_PATH
7272 else :
7373 self .path = path
74- self ._socket = tempfile .mkstemp (prefix = "pyosqsock" )
7574
7675 # Disable logging for the thrift module (can be loud).
7776 logging .getLogger ('thrift' ).addHandler (logging .NullHandler ())
@@ -88,9 +87,16 @@ def __init__(self, path=None):
8887 def __del__ (self ):
8988 if self .connection is not None :
9089 self .connection .close ()
90+ self .connection = None
9191 if self .instance is not None :
9292 self .instance .kill ()
9393 self .instance .wait ()
94+ self .instance = None
95+
96+ # On macOS and Linux mkstemp opens a descriptor.
97+ if self ._socket is not None and self ._socket [0 ] is not None :
98+ os .close (self ._socket [0 ])
99+ self ._socket = None
94100
95101 def open (self , timeout = 2 , interval = 0.01 ):
96102 """
You can’t perform that action at this time.
0 commit comments