Skip to content

Commit 8280d0c

Browse files
committed
Merge branch 'develop' of https://github.com/PythonCharmers/python-future into develop
2 parents fc0b300 + a61c9ab commit 8280d0c

File tree

4 files changed

+23
-12
lines changed

4 files changed

+23
-12
lines changed

README.rst

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ Code examples
5757
Replacements for Py2's built-in functions and types are designed to be imported
5858
at the top of each Python module together with Python's built-in ``__future__``
5959
statements. For example, this code behaves identically on Python 2.6/2.7 after
60-
these imports as it does on Python 3.3+::
60+
these imports as it does on Python 3.3+:
61+
62+
.. code-block:: python
6163
6264
from __future__ import absolute_import, division, print_function
6365
from future.builtins import (bytes, str, open, super, range,
@@ -127,7 +129,9 @@ these imports as it does on Python 3.3+::
127129
128130
129131
There is also support for renamed standard library modules in the form of import
130-
hooks. The context-manager form works like this::
132+
hooks. The context-manager form works like this:
133+
134+
.. code-block:: python
131135
132136
from future import standard_library
133137
@@ -164,15 +168,19 @@ mostly unchanged on both Python 2 and Python 3.
164168
Futurize: 2 to both
165169
--------------------
166170

167-
For example, running ``futurize -w mymodule.py`` turns this Python 2 code::
171+
For example, running ``futurize -w mymodule.py`` turns this Python 2 code:
172+
173+
.. code-block:: python
168174
169175
import ConfigParser
170176
171177
class Blah(object):
172178
pass
173179
print 'Hello',
174180
175-
into this code which runs on both Py2 and Py3::
181+
into this code which runs on both Py2 and Py3:
182+
183+
.. code-block:: python
176184
177185
from __future__ import print_function
178186
from future import standard_library
@@ -196,14 +204,18 @@ The ``past`` package can now automatically translate some simple Python 2
196204
modules to Python 3 upon import. The goal is to support the "long tail" of
197205
real-world Python 2 modules (e.g. on PyPI) that have not been ported yet. For
198206
example, here is how to use a Python 2-only package called ``plotrique`` on
199-
Python 3. First install it::
207+
Python 3. First install it:
208+
209+
.. code-block:: bash
200210
201211
$ pip3 install plotrique==0.2.5-7 --no-compile # to ignore SyntaxErrors
202212
203213
(or use ``pip`` if this points to your Py3 environment.)
204214

205215
Then pass a whitelist of module name prefixes to the ``autotranslate()`` function.
206-
Example::
216+
Example:
217+
218+
.. code-block:: bash
207219
208220
$ python3
209221

docs/whatsnew.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,9 @@ Many small improvements and fixes have been made across the project. Some highli
247247

248248
- Improved compatibility with py2exe (`issue #31 <https://github.com/PythonCharmers/python-future/issues/31>`_).
249249

250-
- The ``future.utils.bytes_to_native_str`` function now returns a ``newbytes``
251-
object on Py2. (`Issue #47
252-
<https://github.com/PythonCharmers/python-future/issues/47>`_).
250+
- The ``future.utils.bytes_to_native_str`` function now returns a platform-native string
251+
object and ``future.utils.native_str_to_bytes`` returns a ``newbytes`` object on Py2.
252+
(`Issue #47 <https://github.com/PythonCharmers/python-future/issues/47>`_).
253253

254254
- The backported ``http.client`` module and related modules use other new
255255
backported modules such as ``email``. As a result they are more compliant

future/tests/test_standard_library.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,10 @@ def test_can_import_several(self):
3636

3737
import future.moves.urllib.parse as urllib_parse
3838
import future.moves.urllib.request as urllib_request
39-
from future.moves.test import support
4039

4140
with standard_library.hooks():
4241
import http.server
43-
for m in [urllib_parse, urllib_request, http.server, support]:
42+
for m in [urllib_parse, urllib_request, http.server]:
4443
self.assertTrue(m is not None)
4544

4645
def test_is_py2_stdlib_module(self):

past/tests/test_builtins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from past.builtins import reduce, reload, unichr, unicode, xrange
88

99
from future import standard_library
10-
from future.moves.test.support import TESTFN #, run_unittest
10+
from future.backports.test.support import TESTFN #, run_unittest
1111
import tempfile
1212
import os
1313
TESTFN = tempfile.mkdtemp() + os.path.sep + TESTFN

0 commit comments

Comments
 (0)