()
| 73 | |
| 74 | |
| 75 | def _log_exception(): |
| 76 | type_, value_, traceback_ = sys.exc_info() |
| 77 | |
| 78 | with open(_log_file, 'a') as fp: |
| 79 | from traceback import format_exception |
| 80 | res = ''.join( |
| 81 | format_exception(type_, value_, traceback_) |
| 82 | ) |
| 83 | |
| 84 | fp.write('EXCEPTION::\n{0}'.format(res)) |
| 85 | return res |
| 86 | |
| 87 | |
| 88 | # Copied the 'UTC' class from the 'pytz' package to allow to run this script |
no test coverage detected