tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
L\¬Qc@sÖdZddlmZdddddgZiZdd„Zd    „Zye    Wne
k
ranXd
„Z ee    e e    ƒd „Z dZ d„Zd„Zd„ZiZiZiZd„Zd„Zd„ZdS(s¬Helper to provide extensibility for pickle/cPickle.
 
This is only useful to add pickle support for extension types defined in
C, not for instances of user-defined classes.
iÿÿÿÿ(t    ClassTypetpicklet constructort add_extensiontremove_extensiontclear_extension_cachecCsft|ƒtkr!tdƒ‚nt|dƒs?tdƒ‚n|t|<|dk    rbt|ƒndS(Ns-copy_reg is not intended for use with classest__call__s$reduction functions must be callable(ttypet
_ClassTypet    TypeErrorthasattrtdispatch_tabletNoneR(tob_typetpickle_functiontconstructor_ob((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyRs
 cCs"t|dƒstdƒ‚ndS(NRsconstructors must be callable(R
R    (tobject((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyRscCst|j|jffS(N(tcomplextrealtimag(tc((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pytpickle_complex'scCsY|tkrtj|ƒ}n7|j||ƒ}|jtjkrU|j||ƒn|S(N(Rt__new__t__init__(tclstbasetstatetobj((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyt_reconstructor.s  ii    cCs8|dkst‚x;|jjD]'}t|dƒr|jt@ rPqqWt}|tkred}n.||jkr‡td|j    ‚n||ƒ}|j||f}y |j
}WnYt k
r t |ddƒrãtdƒ‚ny |j }Wqt k
r    d}qXn
X|ƒ}|r*t||fSt|fSdS(Nit    __flags__scan't pickle %s objectst    __slots__sNa class that defines __slots__ without defining __getstate__ cannot be pickled(tAssertionErrort    __class__t__mro__R
Rt    _HEAPTYPERR R    t__name__t __getstate__tAttributeErrortgetattrt__dict__R(tselftprotoRRtargstgetstatetdict((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyt
_reduce_ex;s0               cGs|j||ŒS(N(R(RR*((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyt
__newobj__\scCs|jjdƒ}|dk    r"|Sg}t|dƒs:nºx·|jD]¬}d|jkrD|jd}t|tƒr|f}nxl|D]a}|dkr qˆqˆ|jdƒrÜ|jdƒ rÜ|j    d|j
|fƒqˆ|j    |ƒqˆWqDqDWy ||_ WnnX|S(    s›Return a list of slot names for a given class.
 
    This needs to find slots defined by the class and its bases, so we
    can't simply return the __slots__ attribute.  We must walk down
    the Method Resolution Order and concatenate the __slots__ of each
    class found there.  (This assumes classes don't modify their
    __slots__ attribute to misrepresent their slots after the class is
    defined.)
    t __slotnames__RR't __weakref__t__s_%s%sN(s__dict__s __weakref__( R'tgetR R
R!t
isinstancet
basestringt
startswithtendswithtappendR#R/(RtnamesRtslotstname((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyt
_slotnames_s,       cCsØt|ƒ}d|ko#dkns4td‚n||f}tj|ƒ|krntj|ƒ|krndS|tkr—td|t|fƒ‚n|tkrÀtd|t|fƒ‚n|t|<|t|<dS(sRegister an extension code.iiÿÿÿscode out of rangeNs)key %s is already registered with code %ss$code %s is already in use for key %s(tintt
ValueErrort_extension_registryR2t_inverted_registry(tmoduleR:tcodetkey((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyRs     
cCsw||f}tj|ƒ|ks6tj|ƒ|krOtd||fƒ‚nt|=t|=|tkrst|=ndS(s0Unregister an extension code.  For testing only.s%key %s is not registered with code %sN(R>R2R?R=t_extension_cache(R@R:RARB((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyR¯s  cCstjƒdS(N(RCtclear(((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyR»sNi(t__doc__ttypesRRt__all__R R RRRt    NameErrorRRR"R-R.R;R>R?RCRRR(((sP/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/copy_reg.pyt<module>s.                     !        8