Commits

mattip  committed 341a34c

on windows, search for sqlite3.dll first next to the exe, then on the path, fixes packaged pypy 'import sqlite3'

  • Participants
  • Parent commits 10b9935

Comments (0)

Files changed (1)

File lib_pypy/_sqlite3.py

     typedef ... sqlite3;
     int sqlite3_enable_load_extension(sqlite3 *db, int onoff);
     """)
-    unverified_lib = unverified_ffi.dlopen('sqlite3')
+    libname = 'sqlite3'
+    if sys.platform == 'win32':
+        _libname = os.path.join(os.path.dirname(sys.executable), libname)
+        if os.path.exists(_libname + '.dll'):
+            libname = _libname
+    unverified_lib = unverified_ffi.dlopen(libname)
     return hasattr(unverified_lib, 'sqlite3_enable_load_extension')
 
 if _has_load_extension():