Unverified Commit 068b5071 authored by tak2hu's avatar tak2hu Committed by GitHub
Browse files

use os.name instead of try except to load lib

parent 6910f3f0
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -42,11 +42,12 @@ class CMatT(ctypes.Structure):
        ('dtype', ctypes.c_int)
    ]
    
try:
    PMLIB = ctypes.CDLL('data/libs/patchmatch_inpaint.dll')
except:
    PMLIB = ctypes.CDLL('data/libs/libpatchmatch.so')
if os.name == 'nt':
    patchmatchlib = 'data/libs/patchmatch_inpaint.dll'
else:
    patchmatchlib = 'data/libs/libpatchmatch.so'

PMLIB = ctypes.CDLL(patchmatchlib)
PMLIB.PM_set_random_seed.argtypes = [ctypes.c_uint]
PMLIB.PM_set_verbose.argtypes = [ctypes.c_int]
PMLIB.PM_free_pymat.argtypes = [CMatT]