aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2019-04-04 14:45:30 -0700
committerBryan Newbold <bnewbold@robocracy.org>2019-04-04 14:45:30 -0700
commit3d992047a83d0668e484700f7077753752adee21 (patch)
tree261a960507c715ece645ddc0cb56448323d59df4
parentd5309e6e2d8d8cd4244e24ac1773ce76434ce46d (diff)
downloadfatcat-3d992047a83d0668e484700f7077753752adee21.tar.gz
fatcat-3d992047a83d0668e484700f7077753752adee21.zip
monkeypatch annoying pytest shutdown exception
-rwxr-xr-xpython_client/codegen_python_client.sh20
-rw-r--r--python_client/fatcat_client/api_client.py7
2 files changed, 25 insertions, 2 deletions
diff --git a/python_client/codegen_python_client.sh b/python_client/codegen_python_client.sh
index 5ab0ff92..5a30910d 100755
--- a/python_client/codegen_python_client.sh
+++ b/python_client/codegen_python_client.sh
@@ -25,6 +25,26 @@ mkdir -p fatcat_client
cp -r $OUTPUT/fatcat_client/* fatcat_client
cp $OUTPUT/README.md README.md
+# fix an annoying/buggy __del__() in codegen
+patch -p0 << END_PATCH
+--- fatcat_client/api_client.py
++++ fatcat_client/api_client.py
+@@ -76,8 +76,11 @@ class ApiClient(object):
+ self.user_agent = 'Swagger-Codegen/1.0.0/python'
+
+ def __del__(self):
+- self.pool.close()
+- self.pool.join()
++ try:
++ self.pool.close()
++ self.pool.join()
++ except:
++ pass
+
+ @property
+ def user_agent(self):
+END_PATCH
+
# these tests are basically no-ops
mkdir -p tests/codegen
cp -r $OUTPUT/test/* tests/codegen
diff --git a/python_client/fatcat_client/api_client.py b/python_client/fatcat_client/api_client.py
index 8ebab103..af25fc2c 100644
--- a/python_client/fatcat_client/api_client.py
+++ b/python_client/fatcat_client/api_client.py
@@ -76,8 +76,11 @@ class ApiClient(object):
self.user_agent = 'Swagger-Codegen/1.0.0/python'
def __del__(self):
- self.pool.close()
- self.pool.join()
+ try:
+ self.pool.close()
+ self.pool.join()
+ except:
+ pass
@property
def user_agent(self):