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 4
4
"""
5
5
6
6
__title__ = "osquery"
7
- __version__ = "3.0.5 "
7
+ __version__ = "3.0.6 "
8
8
__author__ = "osquery developers"
9
9
__license__ = "BSD"
10
10
__copyright__ = "Copyright 2015 Facebook"
Original file line number Diff line number Diff line change @@ -71,7 +71,6 @@ def __init__(self, path=None):
71
71
self .path = LINUX_BINARY_PATH
72
72
else :
73
73
self .path = path
74
- self ._socket = tempfile .mkstemp (prefix = "pyosqsock" )
75
74
76
75
# Disable logging for the thrift module (can be loud).
77
76
logging .getLogger ('thrift' ).addHandler (logging .NullHandler ())
@@ -88,9 +87,16 @@ def __init__(self, path=None):
88
87
def __del__ (self ):
89
88
if self .connection is not None :
90
89
self .connection .close ()
90
+ self .connection = None
91
91
if self .instance is not None :
92
92
self .instance .kill ()
93
93
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
94
100
95
101
def open (self , timeout = 2 , interval = 0.01 ):
96
102
"""
You can’t perform that action at this time.
0 commit comments