
                         P    d Z ddlZddlZ ej                  ddd       dad Zd Zy)zImport this module to add a hook to call pdb on uncaught exceptions.

To enable this, do the following in your top-level application:

import google.apputils.debug

and then in your main():

google.apputils.debug.Init()

Then run your program with --pdb.
    Npdbz$Drop into pdb on uncaught exceptionsc                    t         j                  j                  r.t        t        d      st        j
                  j                         st        | ||       y dd l}dd l}|j                  | ||       t         |j                          y )Nps1r   )flagsFLAGSr   hasattrsysstderrisattyold_excepthook	tracebackprint_exceptionprintpm)	exc_classvaluetbr   r   s        0platform/bq/third_party/google/apputils/debug.py_DebugHandlerr   (   sY    	GC/szz7H7H7J 9eR( i3	FFH    c                  B    t         j                  at        t         _        y )N)r	   
excepthookr   r    r   r   Initr   8   s     >>. #.r   )__doc__r	   gflagsr   DEFINE_booleanr   r   r   r   r   r   <module>r      s6         UAE F !r   