(app=None)
| 161 | |
| 162 | |
| 163 | def _app_or_default_trace(app=None): # pragma: no cover |
| 164 | from traceback import print_stack |
| 165 | try: |
| 166 | from billiard.process import current_process |
| 167 | except ImportError: |
| 168 | current_process = None |
| 169 | if app is None: |
| 170 | if getattr(_tls, 'current_app', None): |
| 171 | print('-- RETURNING TO CURRENT APP --') # + |
| 172 | print_stack() |
| 173 | return _tls.current_app |
| 174 | if not current_process or current_process()._name == 'MainProcess': |
| 175 | raise Exception('DEFAULT APP') |
| 176 | print('-- RETURNING TO DEFAULT APP --') # + |
| 177 | print_stack() |
| 178 | return default_app |
| 179 | return app |
| 180 | |
| 181 | |
| 182 | def enable_trace(): |
nothing calls this directly
no test coverage detected