+
    Dfj                        a  R t0 t R t^ RIt^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ]P                  ! 4       s ! R R4      t/ t] ^ k R tR	 t ! R
 R]4      tR tR tRR ltR# )z&
*Real* reloading support for Python.
N)reload)
ModuleType)Dict)logreflectc                   :   a  ] tR t^t o Rt]tR tR tR tRt	V t
R# )	Sensitivez
A utility mixin that's sensitive to rebuilds.

This is a mixin for classes (usually those which represent collections of
callbacks) to make sure that their code is up-to-date before running.
c                ,    V P                   \         8  pV# NlastRebuild)selfyns   & 8/usr/lib/python3/dist-packages/twisted/python/rebuild.pyneedRebuildUpdateSensitive.needRebuildUpdate$   s    +	    c                :    \         P                   ! 4       V n        R # r
   )timer   r   s   &r   rebuildUpToDateSensitive.rebuildUpToDate(   s    99;r   c                N   \        V4      pV\        P                  8X  d   \        V4      # V\        P                  8X  dO   VP
                  f!   \        VP                  VP                  4      # \        VP
                  VP                  4      # \        P                  ! R4       V# )z
Get the latest version of an object.

This can handle just about anything callable; instances, functions,
methods, and classes.
zwarning returning anObject!)typetypesFunctionTypelatestFunction
MethodType__self__getattrim_class__name__r   msg)r   anObjectts   && r   latestVersionOfSensitive.latestVersionOf+   s     N"""!(++%"""  (x00(2C2CDDx00(2C2CDDGG12Or   r   N)r!   
__module____qualname____firstlineno____doc__r   r   r   r%   __static_attributes____classdictcell__)__classdict__s   @r   r   r      s%      K' r   r   c                    \        V P                  4      p\        P                  V4      pVf   V # \	        W P
                  4      # )z'
Get the latest version of a function.
)id__globals___modDictIDMapgetr   r!   )oldFuncdictIDmodules   &  r   r   r   B   s?     ##$Fv&F~6++,,r   c                   \         P                  ! V P                  4      p\        WP                  4      pVP
                   Uu. uF  p\        V4      NK  	  ppVP                  R8X  d   V#  \        V4      Vn        V# u upi   \         d?    \        T4      pT! TP                  \        T4      \        TP                  4      4      u # i ; i)z$
Get the latest version of a class.
builtins)r   namedModuler'   r   r!   	__bases__latestClasstuple	TypeErrorr   dict__dict__)oldClassr5   newClassbasenewBasesctors   &     r   r:   r:   O   s       !4!45Fv001H.6.@.@A.@dD!.@HAj(Q"8_ B  QH~H%%uXX=N=N8OPPQs   B .B ACCc                       ] tR t^dtRtRtR# )RebuildErrorzL
Exception raised when trying to rebuild a class whereas it's not possible.
 N)r!   r'   r(   r)   r*   r+   rF   r   r   rE   rE   d   s    r   rE   c                :    \        V P                  4      V n        R# )z$
Updates an instance to be current.
N)r:   	__class__r   s   &r   updateInstancerI   j   s     !0DNr   c                    VR8X  d   \        R4      h\        V 4       \        P                  ! R\        P
                  ! V P                  4       RV R24       \        W4      pV# )z4
A getattr method to cause a class to be refreshed.
__del__zWithout this, Python segfaults.z(rebuilding stale z instance (z)))AttributeErrorrI   r   r"   r   qualrH   r   )r   nameresults   && r   __injectedgetattr__rP   q   sY     y>??4GG dnn!= >k$rRST FMr   c                4   \         P                   ! 4       s\        V R4      '       d   V P                  '       g   \	        R4      hV'       d.   \
        P                  ! R\        V P                  4       R24       ^ RI	H
p RVn        V P                  pV \        \        V4      &   / p/ p/ p/ pV'       d.   \
        P                  ! R\        V P                  4       R24       VP                  4        EF  w  r\!        \#        V	4      \$        P&                  4      '       dj   V	P(                  V P                  J dN   ^Wi&   V'       d@   \
        P*                  P-                  R	4       \
        P*                  P/                  4        K  K  K  \1        V	\"        4      '       g   K  V	P2                  V P                  8X  g   K  ^WI&   V'       g   K  \
        P*                  P-                  R
4       \
        P*                  P/                  4        EK  	  VP5                  V4       VP5                  V4       VP6                  p
VP9                  4       pVP9                  4       pVP9                  4       pV'       dD   \
        P                  ! R4       \
        P                  ! R\        V P                  4       R24       \;        V 4       \<        P>                  ! 4        V'       d.   \
        P                  ! R\        V P                  4       R24       V F  p\A        WP                  4      VJ d1   \
        P                  ! R\B        PD                  ! V4       R24       KL  V'       d>   \
        P*                  P-                  R4       \
        P*                  P/                  4        RVn#        VP                  PI                  4        \J        Vn&        V P                  Vn        K  	  V'       d   ^ RI'pV F  p\A        WP                  4      pWJ d<   \
        P                  ! RPQ                  \B        PD                  ! V4      4      4       KX  XPS                  V4       F  p\A        VRR4      VJ g   K  Wn*        K  	  K  	  V'       dD   \
        P                  ! R4       \
        P                  ! R\        V P                  4       R24       ^ p\V        PX                  P                  4        EFG  w  ppV^,           pVV 8X  g   Vf   K  \        VR4      '       g   K1  \        VR4      '       d   KE  ^ pVP                  P                  4        F  w  r \[        V	4       T
! T	4      '       g   K!  T'       d>   \
        P*                  P-                  R	4       \
        P*                  P/                  4        \_        T	4      p^p\a        TTT4       K  	  V'       g   K  V'       d   K  V^
,          ^ 8X  g   EK
  \
        P*                  P-                  R4       \
        P*                  P/                  4        EKJ  	  RVn        V'       dD   \
        P                  ! R4       \
        P                  ! R\        V P                  4       R24       V #   \\         d     EKN  i ; i)zG
Reload a module and do as much as possible to replace its references.
ALLOW_TWISTED_REBUILDzI am not allowed to be rebuilt.zRebuilding z...)
componentsTz  (scanning z): fo z  (reload   )z  (cleaning zWARNING: class z not replaced by reload!xNz-WARNING: new-class {} not replaced by reload!rH   z  (fixing   __file__
__bundle__.Fz   Rebuilt rF   )1r   r   hasattrrR   RuntimeErrorr   r"   strr!   twisted.pythonrS   ALLOW_DUPLICATESr>   r1   r/   items
issubclassr   r   r   r0   logfilewriteflush
isinstancer'   update__contains__keysr   	linecache
clearcacher   r   rM   r9   clearrP   __getattr__gcformatget_referrersrH   sysmoduleshash	Exceptionr   setattr)r5   doLogrS   d
newclassesclasses	functionsvalueskvfromOldModuleclazzrn   nclassgarmodcountmkmodchangednvs   &&                   r   rebuildr   }   s   
 ))+Kv.//+++@AA+c&//23378 *"&JA!M"Q%JGIF,s6??34C89	d1gu1122}}/ 	KK%%c*KK%%'  0
 4  ||v. !
5KK%%c*KK%%'  MM'
MM)''M"JllnG I,s6??34A67 6N,s6??34C896>>*e3GGogll5&9%::RST!!#&!!# EONN  " 3E%E  V__-<GG?FFLL( %%f-1k40F:"$K .  ,s6??34C89H;;$$&Ca<&=CKsJ''3%% LL&&(DAQ QKK%%c*KK%%'#A&Q# ) 5x"}&:KKc"KK? 'B #(J+c&//23156M#  s   ZZZc                b    V ^8  d   Qh/ ^ \         9   d   \        \        \        3,          ;R&   # )   r1   )__conditional_annotations__r   intr   )ro   s   "r   __annotate__r      s)      r * )tCO$ )sr   )   )r   r*   rj   rq   r   r   	importlibr   r   typingr   r_   r   r   r   r   r1   r   r:   rt   rE   rI   rP   r   r   )r   s   @r   <module>r      sp           (iik" "J (* )
-Q*9 1	}r   