(cx, category=sqlite3.SQLITE_LIMIT_SQL_LENGTH, limit=128)
| 16 | # Temporarily limit a database connection parameter |
| 17 | @contextlib.contextmanager |
| 18 | def cx_limit(cx, category=sqlite3.SQLITE_LIMIT_SQL_LENGTH, limit=128): |
| 19 | try: |
| 20 | _prev = cx.setlimit(category, limit) |
| 21 | yield limit |
| 22 | finally: |
| 23 | cx.setlimit(category, _prev) |
| 24 | |
| 25 | |
| 26 | def with_tracebacks(exc, regex="", name="", msg_regex=""): |
no outgoing calls
searching dependent graphs…