Dashboard
PHP:
8.3.33
OS:
Linux
User:
letter7
/
/
usr
/
lib
/
mysqlsh
/
lib
/
python3.8
/
site-packages
/
__pycache__
📤 Upload
📝 New File
📁 New Folder
Close
Editing: circuitbreaker.cpython-38.pyc
U �:�e�( � @ s< d dl mZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZmZ d dl m Z mZ d dlm Z mZ d d lmZmZ zd d lmZ W n ek r� d d lmZ Y nX z efZW n ek r� eefZY nX dZdZd Zdd� Zdd� ZG dd� de�Z G dd� de!�Z"G dd� de�Z#ddddde fdd�Z$dS )� )�unicode_literals)�division)�print_function)�absolute_import)�wraps)�datetime� timedelta)�isgeneratorfunction�isclass)�AnyStr�Iterable)�ceil�floor)� monotonic�closed�openZ half_openc s � fdd�}|S )zOBuild a predicate function that checks if an exception is a subtype from a listc s t | � �S �N)� issubclass)Zthrown_type�_�� exc_types� �A/usr/local/python38/lib/python3.8/site-packages/circuitbreaker.py� matches_types s z(in_exception_list.<locals>.matches_typesr )r r r r r �in_exception_list s r c C sx t | �rt| t�rt| �}nXz&t| � t| t�r8td��t| � }W n0 tk rr t | �rbt | �rjtd��| }Y nX |S )az Build a failure predicate_function. The returned function has the signature (Type[Exception], Exception) -> bool. Return value True indicates a failure in the underlying function. :param expected_exception: either an type of Exception, iterable of Exception types, or a predicate function. If an Exception type or iterable of Exception types, the failure predicate will return True when a thrown exception type matches one of the provided types. If a predicate function, it will just be returned as is. :return: callable (Type[Exception], Exception) -> bool z9expected_exception cannot be a string. Did you mean name?z1expected_exception does not look like a predicate) r r � Exceptionr �iter� isinstance�STRING_TYPES� ValueError� TypeError�callable)�expected_exceptionZfailure_predicater r r �build_failure_predicate&