
    sg                    p    d Z ddlmZ ddlZddlmZ ddlmZ dgZ eej                  d	      dd
       Z	y)z
Python polyfills for os
    )annotationsN)AnyStr   )substitute_in_graphfspathT)can_constant_fold_throughc                ^   t        | t        t        f      r| S t        |       }	 |j	                  |       }t        |t        t        f      r|S t        d|j                   dt        |      j                         # t
        $ r' t        |d      r t        d|j                         d w xY w)N
__fspath__z/expected str, bytes or os.PathLike object, not z	expected z*.__fspath__() to return str or bytes, not )	
isinstancestrbytestyper
   AttributeErrorhasattr	TypeError__name__)path	path_type	path_reprs      M/var/www/html/venv/lib/python3.12/site-packages/torch/_dynamo/polyfills/os.pyr   r      s    $e%T
I((.	 )c5\*

I&&' (I''(	*   9l+=i>P>P=QR
	s   A< <0B,)r   zAnyStr | os.PathLike[AnyStr]returnr   )
__doc__
__future__r   ostypingr   
decoratorsr   __all__r        r   <module>r       sA    # 	  , * RYY$? @r   