B
    <[)                 @   s|   d Z ddlZejdk r0e ZZdZddlmZ	 n$ddl
Z
e
jZdZdd Zed	j	Z	ejd
k rxddl
Z
i i g dfddZdS )a  
Python 2/3 compatibility definitions.

This module currently provides the following helper symbols:

* bytes (name of byte string type; str in 2.x, bytes in 3.x)
* b (function converting a string literal to an ASCII byte string;
  can be also used to convert a Unicode string into a byte string)
* u_prefix (unicode repr prefix: 'u' in 2.x, '' in 3.x)
  (Required in docutils/test/test_publisher.py)
* BytesIO (a StringIO class that works with bytestrings)
    N)   r   u)StringIO c             C   s4   t | tr| dS t | tr"| S td| f d S )Nlatin1zInvalid argument %r for b())
isinstancestrencodebytes	TypeError)s r   /lib/python3.7/site-packages/docutils/_compat.pyb   s
    


r   io)      c             C   s   t | |||S )zxCompatibility definition for Python 2.4.

        Silently ignore the `level` argument missing in Python < 2.5.
        )builtins
__import__)nameglobalslocalsfromlistlevelr   r   r   r   *   s    r   )__doc__sysversion_infor   r   r
   Zu_prefixr   r   BytesIOr   r   r   r   r   r   <module>   s   
	

