o
    i-                     @   s^   d Z dZddlmZ ddlZG dd deZG dd deZejZ	d	Z
d
ZdZdZdd ZdS )zProtobuf Runtime versions and validators.

It should only be accessed by Protobuf gencodes and tests. DO NOT USE it
elsewhere.
zshaod@google.com (Dennis Shao)    )EnumNc                   @   s   e Zd ZdZdZdS )Domain      N)__name__
__module____qualname__GOOGLE_INTERNALPUBLIC r   r   Z/var/www/edux/Edux_v2/venv/lib/python3.10/site-packages/google/protobuf/runtime_version.pyr      s    r   c                   @   s   e Zd ZdZdS )VersionErrorz&Exception class for version violation.N)r   r   r   __doc__r   r   r   r   r      s    r         r    c           
   	   C   s0  t d}|dur| dkrdS t dt dt t }| d| d| | }|dk s5|dk s5|dk r<td| d}	| tkrRtd| d	| j	 d
tj	 d|tkrftd| d	| d
| d|	 t|k srt|krt|k rtd| d	| d
| d|	 |tkrtd| d	| d
| d|	 dS )a  Function to validate versions.

  Args:
    gen_domain: The domain where the code was generated from.
    gen_major: The major version number of the gencode.
    gen_minor: The minor version number of the gencode.
    gen_patch: The patch version number of the gencode.
    gen_suffix: The version suffix e.g. '-dev', '-rc1' of the gencode.
    location: The proto location that causes the version violation.

  Raises:
    VersionError: if gencode version is invalid or incompatible with the
    runtime.
  )TEMORARILY_DISABLE_PROTOBUF_VERSION_CHECKNtrue.r   zInvalid gencode version: z`See Protobuf version guarantees at https://protobuf.dev/support/cross-version-runtime-guarantee.zBDetected mismatched Protobuf Gencode/Runtime domains when loading z
: gencode z	 runtime z2. Cross-domain usage of Protobuf is not supported.zIDetected mismatched Protobuf Gencode/Runtime major versions when loading z". Same major version is required. zEDetected incompatible Protobuf Gencode/Runtime versions when loading zC. Runtime version cannot be older than the linked gencode version. zKDetected mismatched Protobuf Gencode/Runtime version suffixes when loading z%. Version suffixes must be the same. )
osgetenvlowerMAJORMINORPATCHSUFFIXr   DOMAINname)

gen_domain	gen_major	gen_minor	gen_patch
gen_suffixlocationdisable_flagversiongen_versionerror_promptr   r   r   ValidateProtobufRuntimeVersion&   sp   
r(   )r   
__author__enumr   r   r   	Exceptionr   r
   r   r   r   r   r   r(   r   r   r   r   <module>   s   