U
    6d_                     @   sV   d dl mZ zd dlmZ W n  ek
r<   d dlmZ Y nX d dlmZ dd ZdS )    )dumps)	parse_qsl)
to_unicodec                 C   s   dd }|  d| | S )Nc                 S   s   d| j di kr| S d| j di krF| jdkrFtt| jdd}n| S |d}|d k	rd||d< d	|d
< tt|d| _	| S )Nzapplication/jsonzcontent-typez
text/plain   T)keep_blank_valuesexpiresZ
expires_inZBearer
token_typezUTF-8)
headersgetstatus_codedictr   textr   r   encode_content)rtokenr    r   O/tmp/pip-unpacked-wheel-h5x5xq8v/requests_oauthlib/compliance_fixes/facebook.py_compliance_fix   s    
z0facebook_compliance_fix.<locals>._compliance_fixZaccess_token_response)Zregister_compliance_hook)sessionr   r   r   r   facebook_compliance_fix   s    r   N)	jsonr   urlparser   ImportErrorurllib.parseZoauthlib.commonr   r   r   r   r   r   <module>   s   