Skip to content

Commit 4606bb2

Browse files
committed
Add PEP 3108 moved stdlib packages to the top level
1 parent d07865a commit 4606bb2

35 files changed

+359
-0
lines changed

_dummy_thread/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from _dummy_thread import *
6+
else:
7+
__future_module__ = True
8+
from dummy_thread import *

_markupbase/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from _markupbase import *
6+
else:
7+
__future_module__ = True
8+
from markupbase import *

_thread/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from _thread import *
6+
else:
7+
__future_module__ = True
8+
from thread import *

builtins/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from builtins import *
6+
else:
7+
__future_module__ = True
8+
from __builtin__ import *
9+
# Overwrite any old definitions with the equivalent future.builtins ones:
10+
from future.builtins import *

configparser/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
3+
from future.utils import PY2
4+
5+
if PY2:
6+
from ConfigParser import *
7+
else:
8+
from configparser import *

copyreg/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from copyreg import *
6+
else:
7+
__future_module__ = True
8+
from copy_reg import *

docs/standard_library_imports.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ List of moved standard library modules
1515

1616
The complete list of modules available via one of the interfaces below is::
1717

18+
import builtins
19+
1820
from collections import Counter, OrderedDict # backported to Py2.6
1921
from collections import UserDict, UserList, UserString
2022

@@ -47,6 +49,8 @@ The complete list of modules available via one of the interfaces below is::
4749

4850
from sys import intern
4951

52+
from tkinter import ...
53+
5054
import urllib.error
5155
import urllib.parse
5256
import urllib.request

html/__init__.py

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
from __future__ import absolute_import, unicode_literals
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from html import *
6+
else:
7+
__future_module__ = True
8+
9+
# cgi.escape isn't good enough for the single Py3.3 html test to pass.
10+
# Define it inline here instead. From the Py3.3 stdlib
11+
"""
12+
General functions for HTML manipulation.
13+
"""
14+
15+
16+
_escape_map = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;'}
17+
_escape_map_full = {ord('&'): '&amp;', ord('<'): '&lt;', ord('>'): '&gt;',
18+
ord('"'): '&quot;', ord('\''): '&#x27;'}
19+
20+
# NB: this is a candidate for a bytes/string polymorphic interface
21+
22+
def escape(s, quote=True):
23+
"""
24+
Replace special characters "&", "<" and ">" to HTML-safe sequences.
25+
If the optional flag quote is true (the default), the quotation mark
26+
characters, both double quote (") and single quote (') characters are also
27+
translated.
28+
"""
29+
if quote:
30+
return s.translate(_escape_map_full)
31+
return s.translate(_escape_map)

html/entities.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from html.entities import *
6+
else:
7+
__future_module__ = True
8+
from htmlentitydefs import *

html/parser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from __future__ import absolute_import
2+
from future.utils import PY3
3+
4+
if PY3:
5+
from html.parser import *
6+
else:
7+
__future_module__ = True
8+
from HTMLParser import *

0 commit comments

Comments
 (0)