§ <ˆj_l ã ó| — d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl Z ddlZ ej d¦ « Z ej ej ¦ « Z ej ¦ « Ze e¦ « e e¦ « e ej ¦ « ddlmZmZ eg d¢¦ « Zddd d ddd dddddddœ Z e ee ¦ « ¦ « ee¦ « z ¦ « dk sJ ‚g d¢Z G d„ de ¦ « Z! G d„ de ¦ « Z"er= e ee ¦ « ¦ « eej# ¦ « z ¦ « dk sJ ‚d„ Z$d„ Z%d„ Z& G d„ de ¦ « Z'd„ Z(d „ Z)d!„ Z*d"„ Z+d/d$„Z,d%„ Z-d&„ Z. e/ed'¦ « si e_0 d(„ Z1d/d)„Z2d*„ Z3 G d+„ d,e ¦ « Z4g d-¢Z5d.„ Z6dS )0a¬ Python 3 reorganized the standard library (PEP 3108). This module exposes several standard library modules to Python 2 under their new Python 3 names. It is designed to be used as follows:: from future import standard_library standard_library.install_aliases() And then these normal Py3 imports work on both Py3 and Py2:: import builtins import copyreg import queue import reprlib import socketserver import winreg # on Windows only import test.support import html, html.parser, html.entites import http, http.client, http.server import http.cookies, http.cookiejar import urllib.parse, urllib.request, urllib.response, urllib.error, urllib.robotparser import xmlrpc.client, xmlrpc.server import _thread import _dummy_thread import _markupbase from itertools import filterfalse, zip_longest from sys import intern from collections import UserDict, UserList, UserString from collections import OrderedDict, Counter, ChainMap # even on Py2.6 from subprocess import getoutput, getstatusoutput from subprocess import check_output # even on Py2.6 (The renamed modules and functions are still available under their old names on Python 2.) This is a cleaner alternative to this idiom (see http://docs.pythonsprints.com/python3_porting/py-porting.html):: try: import queue except ImportError: import Queue as queue Limitations ----------- We don't currently support these modules, but would like to:: import dbm import dbm.dumb import dbm.gnu import collections.abc # on Py33 import pickle # should (optionally) bring in cPickle on Python 2 é )Úabsolute_importÚdivisionÚprint_functionNÚ future_stdlib)ÚPY2ÚPY3)ÚtestÚurllibÚpickleÚdbmÚbuiltinsÚcopyregÚqueueÚsocketserverÚconfigparserÚreprlibÚwinregÚ_threadÚ _dummy_threadÚxmlrpcÚhtmlÚhttpÚ_markupbase) Ú__builtin__Úcopy_regÚQueuezfuture.moves.socketserverÚConfigParserÚreprÚ_winregÚthreadÚdummy_threadzfuture.moves.xmlrpczfuture.moves.htmlzfuture.moves.httpzfuture.moves._markupbase))ÚcollectionsÚUserListr# r# )r" ÚUserDictr$ r$ )r" Ú UserStringr% r% ©r" ÚChainMapúfuture.backports.miscr' )Ú itertoolsÚfilterfalser) Úifilterfalse)r) Úzip_longestr) Úizip_longest)ÚsysÚinternr r/ )ÚreÚASCIIÚstatÚST_MODE)Úbase64Úencodebytesr4 Úencodestring)r4 Údecodebytesr4 Údecodestring)Ú subprocessÚ getoutputÚcommandsr: )r9 Úgetstatusoutputr; r<