ó
¸9—^c           @   sM   d  d l  Z  d  d l Z d  d l m Z e  j ƒ  Z d e _ d d „ Z d S(   iÿÿÿÿN(   t   WSGIHandleriô  c         C   sq   yF t  | j j j j d ƒ t ƒ r0 | t _ n t j rE t j } n  Wn t k
 rY n Xt	 j
 | | | ƒ d S(   s¿  
    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.
    t   selfN(   t
   isinstancet   tb_nextt   tb_framet   f_localst   getR    t   tldt   wsgi_tbt   AttributeErrort   sixt   reraise(   t   requestt   exc_typet	   exc_valuet   tbt   status_code(    (    sQ   /tmp/pip-unpacked-wheel-a0M10Y/django_extensions/management/technical_response.pyt   null_technical_500_response   s    !	(	   t	   threadingR
   t   django.core.handlers.wsgiR    t   localR   t   NoneR   R   (    (    (    sQ   /tmp/pip-unpacked-wheel-a0M10Y/django_extensions/management/technical_response.pyt   <module>   s
   	