From 2975a153d8ba920dd03294f537f7f30c5c077417 Mon Sep 17 00:00:00 2001 From: Segev Finer Date: Tue, 22 Aug 2017 21:20:07 +0300 Subject: [PATCH] Change the libraries hack in the setup.py to only ignore sqlcipher/sqlite3 Sometimes it's necessary to link with additional libraries like when static linking OpenSSL on Windows. The previous hack made this impossible without modifying the setup.py when using --bundled/--amalgamation. --- setup.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 6e6938a..1d3bc03 100644 --- a/setup.py +++ b/setup.py @@ -182,8 +182,12 @@ def build_extension(self, ext): def __setattr__(self, k, v): # Make sure we don't link against the SQLite # library, no matter what setup.cfg says - if self.amalgamation and k == "libraries": - v = None + if self.amalgamation and k == "libraries" and isinstance(v, list): + for i in ["sqlcipher", "sqlite3"]: + try: + v.remove(i) + except ValueError: + pass self.__dict__[k] = v