
    sh_                     Z    S SK r S SKrS SKrS SKrS SKJr   " S S\ R                  5      rg)    N)Pathc                       \ rS rSrS rSrg)TestUnpickleDeletedModule   c                    SR                  / SQ5      nSn[        R                  " 5        n[        R                  R                  U5        [        U SU S35      n[        US5      nUR                  U5        UR                  5         SSK
Jn  S	S	S	5        [        R                  U	 [        R                  " W5      n[        R                  " U5      nU R!                  U" S
5      S5        g	! , (       d  f       Nd= f)ac  Create a module that uses Numba, import a function from it.
Then delete the module and pickle the function. The function
should load from the pickle without a problem.

Note - This is a simplified version of how Numba might be used
on a distributed system using e.g. dask distributed. With the
pickle being sent to the worker but not the original module.

)zfrom numba import vectorizez @vectorize(['float64(float64)'])zdef inc1(x):z    return x + 1
tmp_module/z.pyar   )inc1N      )jointempfileTemporaryDirectorysyspathappendr   openwritecloser	   r   modulespickledumpsloadsassertEqual)selfsourcemodnametmp_dirfilenamefr   pkls           |/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/numba/tests/test_unpickle_without_module.py"test_loading_pickle_with_no_module<TestUnpickleDeletedModule.test_loading_pickle_with_no_module	   s     
 ((*gHHOOG$ wiq	56HXs#AGGFOGGI ( + KK  ll4 LL1q!% +*s   A$C--
C; N)__name__
__module____qualname____firstlineno__r%   __static_attributes__r'       r$   r   r      s    ("r-   r   )unittestr   r   r   pathlibr   TestCaser   r'   r-   r$   <module>r1      s&      
  )" 1 1 )"r-   