##// END OF EJS Templates
Always free
M Bussonnier -
Show More
@@ -190,16 +190,18 try:
190 190 return py_arg_split(commandline, posix=posix, strict=strict)
191 191 argvn = c_int()
192 192 result_pointer = CommandLineToArgvW(commandline.lstrip(), ctypes.byref(argvn))
193 result_array_type = LPCWSTR * argvn.value
194 result = [
195 arg
196 for arg in result_array_type.from_address(
197 ctypes.addressof(result_pointer.contents)
198 )
199 if arg is not None
200 ]
201 # for side effects
202 _ = LocalFree(result_pointer)
193 try:
194 result_array_type = LPCWSTR * argvn.value
195 result = [
196 arg
197 for arg in result_array_type.from_address(
198 ctypes.addressof(result_pointer.contents)
199 )
200 if arg is not None
201 ]
202 finally:
203 # for side effects
204 _ = LocalFree(result_pointer)
203 205 return result
204 206 except AttributeError:
205 207 arg_split = py_arg_split
General Comments 0
You need to be logged in to leave comments. Login now