3
¯ôÁgÞ  ã               @   s0   d dl Z d dlmZ e jƒ Zde_ddd„ZdS )é    N)ÚWSGIHandleréô  c             C   s~   y.t |jjjjdƒtƒr |t_ntjr,tj}W n tk
rB   Y nX z*|dkrT|ƒ }|j	|k	rh|j
|ƒ‚|‚W dd}d}X dS )a¿  
    Alternative function for django.views.debug.technical_500_response.

    Django's convert_exception_to_response() wrapper is called on each 'Middleware' object to avoid
    leaking exceptions. If an uncaught exception is raised, the wrapper calls technical_500_response()
    to create a response for django's debug view.

    Runserver_plus overrides the django debug view's technical_500_response() function to allow for
    an enhanced WSGI debugger view to be displayed. However, because Django calls
    convert_exception_to_response() on each object in the stack of Middleware objects, re-raising an
    error quickly pollutes the traceback displayed.

    Runserver_plus only needs needs traceback frames relevant to WSGIHandler Middleware objects, so
    only store the traceback if it is for a WSGIHandler. If an exception is not raised here, Django
    eventually throws an error for not getting a valid response object for its debug view.
    ÚselfN)Ú
isinstanceÚtb_nextÚtb_frameÚf_localsÚgetr   ÚtldÚwsgi_tbÚAttributeErrorÚ__traceback__Úwith_traceback)ÚrequestÚexc_typeÚ	exc_valueÚtbÚstatus_code© r   úm/var/www/tester-filtro-web/env/lib/python3.6/site-packages/django_extensions/management/technical_response.pyÚnull_technical_500_response
   s    


r   )r   )Ú	threadingZdjango.core.handlers.wsgir   Úlocalr
   r   r   r   r   r   r   Ú<module>   s   