Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -17,6 +17,27 @@ def noop_del(self):
|
|
| 17 |
|
| 18 |
asana.api_client.ApiClient.__del__ = noop_del
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
settings={
|
| 21 |
"PREFER_DATES_FROM": "future",
|
| 22 |
"RELATIVE_BASE": datetime.datetime.now()
|
|
|
|
| 17 |
|
| 18 |
asana.api_client.ApiClient.__del__ = noop_del
|
| 19 |
|
| 20 |
+
```python
|
| 21 |
+
import asana
|
| 22 |
+
import multiprocessing.pool
|
| 23 |
+
|
| 24 |
+
# Monkey patch ApiClient.__del__
|
| 25 |
+
def noop_del(self):
|
| 26 |
+
print("Monkey patched ApiClient.__del__ called. Doing nothing.")
|
| 27 |
+
pass
|
| 28 |
+
|
| 29 |
+
asana.api_client.ApiClient.__del__ = noop_del
|
| 30 |
+
|
| 31 |
+
# Monkey patch multiprocessing.pool.Pool.__del__
|
| 32 |
+
def noop_pool_del(self):
|
| 33 |
+
print("Monkey patched multiprocessing.pool.Pool.__del__ called. Doing nothing.")
|
| 34 |
+
pass
|
| 35 |
+
|
| 36 |
+
multiprocessing.pool.Pool.__del__ = noop_pool_del
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
This will replace the `Pool` class's destructor with a no-op function, similar to what we did for `ApiClient`.
|
| 40 |
+
|
| 41 |
settings={
|
| 42 |
"PREFER_DATES_FROM": "future",
|
| 43 |
"RELATIVE_BASE": datetime.datetime.now()
|