File: //home/arjun/projects/env/lib/python3.10/site-packages/tldextract/__pycache__/cache.cpython-310.pyc
o
+we�! � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl m
Z
mZmZ ddl
mZ ddlmZmZ ddlZddlmZ e�e�Zdaed �Zejd
krXd'dd�ZnejZd(dd�Zd(dd�ZG dd� d�Zd)dd�Zd*d!d"�Z d+d%d&�Z!dS ),zHelpers.� )�annotationsN)�Callable�Hashable�Iterable)�Path)�TypeVar�cast)�FileLockF�T)� � �args�bytes�return�
hashlib._Hashc G s t j| ddi�S )zUse argument only available in newer Python.
In this file, MD5 is only used for cache location, not security.
�usedforsecurityF)�hashlib�md5)r
� r �I/home/arjun/projects/env/lib/python3.10/site-packages/tldextract/cache.pyr s r �strc C s� zddl m} W n ty d} Y nw d| }tj�tj�}ttj� d���
� dd� }d�d d
� tjdd� D ��}||||g}d�|�}|S )
z�
Generate an identifier unique to the python version, tldextract version, and python instance.
This will prevent interference between virtualenvs and issues that might arise when installing
a new version of tldextract
r )�version�devztldextract-�utf-8N� �.c S s g | ]}t |��qS r )r )�.0�vr r r �
<listcomp>7 s z-get_pkg_unique_identifier.<locals>.<listcomp>����__)
�tldextract._versionr �ImportError�os�path�basename�sys�prefixr �encode� hexdigest�join�version_info)r �tldextract_version�python_env_name�python_binary_path_short_hash�python_version�identifier_parts�pkg_identifierr r r �get_pkg_unique_identifier'