a
    
”aÁ  ã                   @   sV   d dl mZmZmZmZ d dlZd dlZejdd„ ƒZddd„Z	ddd„Z
d	d
„ ZdS )é    )Úabsolute_importÚdivisionÚprint_functionÚunicode_literalsNc              	   c   s8   t  ¡ }t  | ¡ z|V  W t  |¡ nt  |¡ 0 dS )z9A context manager for operating in a different directory.N)ÚosÚgetcwdÚchdir)ÚdirnameZorig© r
   ú6lib/python3.9/site-packages/debugpy/_vendored/_util.pyÚcwd   s
    
r   c                 c   s4   | g}|r0|  d¡}t||||ƒD ]
}|V  q"qdS )zŸYield (dirname, basename, filename) for each file in the tree.

    This is an alternative to os.walk() that flattens out the tree and
    with filtering.
    r   N)ÚpopÚ_iter_files)ÚrootÚ	prune_dirÚexclude_fileÚpendingr	   Úresultr
   r
   r   Úiter_all_files   s
    
r   c           	      c   sP   | g}|rL|  d¡}g }t||||ƒD ]\}}}| ||f¡ q&||fV  qdS )z²Yield (dirname, files) for each directory in the tree.

    The list of files is actually a list of (basename, filename).

    This is an alternative to os.walk() with filtering.r   N)r   r   Úappend)	r   r   r   r   r	   ÚfilesÚ_ÚbÚfr
   r
   r   Ú	iter_tree#   s    
r   c                 c   sn   t  | ¡D ]^}t j | |¡}t j |¡rH|d ur<|| |ƒr<q
| |¡ q
|d ur\|| |ƒr\q
| ||fV  q
d S )N)r   ÚlistdirÚpathÚjoinÚisdirr   )r	   Zsubdirsr   r   ÚbasenameÚfilenamer
   r
   r   r   2   s    r   )NN)NN)Z
__future__r   r   r   r   Ú
contextlibr   Úcontextmanagerr   r   r   r   r
   r
   r
   r   Ú<module>   s   



