Decorator to temporarily turn off tracing for the duration of a test. Needed in tests that check refcounting, otherwise the tracing itself influences the refcounts
(func)
| 2476 | |
| 2477 | |
| 2478 | def _no_tracing(func): |
| 2479 | """ |
| 2480 | Decorator to temporarily turn off tracing for the duration of a test. |
| 2481 | Needed in tests that check refcounting, otherwise the tracing itself |
| 2482 | influences the refcounts |
| 2483 | """ |
| 2484 | if not hasattr(sys, 'gettrace'): |
| 2485 | return func |
| 2486 | else: |
| 2487 | @wraps(func) |
| 2488 | def wrapper(*args, **kwargs): |
| 2489 | original_trace = sys.gettrace() |
| 2490 | try: |
| 2491 | sys.settrace(None) |
| 2492 | return func(*args, **kwargs) |
| 2493 | finally: |
| 2494 | sys.settrace(original_trace) |
| 2495 | return wrapper |
| 2496 | |
| 2497 | |
| 2498 | def _get_glibc_version(): |
nothing calls this directly
no outgoing calls
no test coverage detected