PKJϸ4raises/__init__.py# -*- coding: utf-8 -*- """Raises' in your source code, all's right with the Stack Overflow """ __version__ = '0.2' import sys import webbrowser # Compatibility for Python 2 and 3 try: from urllib.parse import urlencode except ImportError: from urllib import urlencode STACKOVERFLOW_URL = 'https://stackoverflow.com/search?tab=votes&{qs}' __enabled = True def raiser(etype, value, tb): if __enabled: error_msg = '{etype}: {value}'.format(etype=etype.__name__, value=value) webbrowser.open(STACKOVERFLOW_URL.format( qs=urlencode({'q': '[python] ' + error_msg})), new=2) # new=2 open in new tab # sys.__excepthook__ is the original excepthook, perform to print traceback # See https://docs.python.org/3/library/sys.html#sys.__excepthook__ sys.__excepthook__(etype, value, tb) def disable(): global __enabled __enabled = False def enable(): global __enabled __enabled = True # Globaly replace sys.excepthook to raiser sys.excepthook = raiser PK!HIWdraises-0.2.dist-info/WHEEL HM K-*ϳR03rOK-J,/RH,Q0343 /, (-JLR()*M ILR(4KM̫#DPK!H!sraises-0.2.dist-info/METADATATn8}MHRdX@h vSԨIڢoE"wH*NmQ 䜹9yQ /:it'S-ht`gyж^'!J TiBCVn[ ^ݓ]+q'6stahXM*N[e$w!+Ҏ=_x g7^ƘZ!Up\=Mk/Hu,{\^NpNe /ݓ2]KV}pX'qiM*NٰR7W7s<:}q}1}0pm+Bo'$~vb"m xz0׬ `tH0߲dW gH0z*K@~~GYq^^sO"ڨY?=nETC\K] rB-Yds9k]*o T13k7$mD4?35Oo:48,y}c,R\㖝b\GǙ!qj| TsY+t6s"WGq **u쏋C|#Kkg#T|d~T4K %kzB;ɏ WQ^'/ <<cu F͂qb5tj5[G6Aa<Ƴcw1//RaԥϰSXh,@Q)+\ U>WRxB6|;3J>a:nli8b&_PK!H raises-0.2.dist-info/RECORDmn0RVia"M PlHcže7,P L+pceGе4Wu5L9L:h+˱]+3Zk~UX,Aegݺ$>oa둳ϔ"D9c [OבKޟ=M24 @칯׌m,`PKJϸ4raises/__init__.pyPK!HIWd/raises-0.2.dist-info/WHEELPK!H!sraises-0.2.dist-info/METADATAPK!H  raises-0.2.dist-info/RECORDPK