Your IP : 216.73.216.213
B
��\� � @ s( d Z ddlZddlZG dd� de�ZdS )z,Utilities for handling deprecated functions.� Nc @ s2 e Zd ZdZdZd
dd�Zdd� Zedd � �ZdS )�
Deprecatorz�Decorator class for adding deprecated functions.
Warnings are switched on by default.
To disable deprecation warnings, use:
>>> from pyfakefs.deprecator import Deprecator
>>>
>>> Deprecator.show_warnings = False
TNc C s || _ || _d S )N)�use_instead� func_name)�selfr r � r �D/opt/alt/python37/lib/python3.7/site-packages/pyfakefs/deprecator.py�__init__ s zDeprecator.__init__c s t �� �� �fdd��}|S )zZDecorator to mark functions as deprecated. Emit warning
when the function is used.c sb �j rXt�dt� d}�jd k r,d��j�}tjd��jp>� j|�tdd� t�dt� � | |�S )N�always� zUse {} instead.z"Call to deprecated function {}. {}� )�category�
stacklevel�default) �
show_warnings�warnings�simplefilter�DeprecationWarningr �format�warnr �__name__)�args�kwargs�message)�funcr r r � _new_func'