Commit 22b430de authored by Sergey Lyubka's avatar Sergey Lyubka

Using ctypes.WinDLL on Windows

parent 7d5eb279
...@@ -118,8 +118,10 @@ class Mongoose(object): ...@@ -118,8 +118,10 @@ class Mongoose(object):
"""A wrapper class for Mongoose shared library.""" """A wrapper class for Mongoose shared library."""
def __init__(self, callback, **kwargs): def __init__(self, callback, **kwargs):
dll_extension = os.name == 'nt' and 'dll' or 'so' if os.name == 'nt':
self.dll = ctypes.CDLL('_mongoose.%s' % dll_extension) self.dll = ctypes.WinDLL('_mongoose.dll')
else:
self.dll = ctypes.CDLL('_mongoose.so')
self.dll.mg_start.restype = ctypes.c_void_p self.dll.mg_start.restype = ctypes.c_void_p
self.dll.mg_modify_passwords_file.restype = ctypes.c_int self.dll.mg_modify_passwords_file.restype = ctypes.c_int
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment