Remove obsolete __future__ imports (related to #264017)

Generators have been available since 2.3, "with" statements since 2.6.

authorRémi Cardona <remi.cardona@free.fr>
changeset38c568b29cf3
branchdefault
phasepublic
hiddenno
parent revision#521effbc6379 [pytest] drop compatibility code for python < 2.4 (related to #264017)
child revision#4cd92eb18936 [configuration] Remove unused imports
files modified by this revision
compat.py
modutils.py
registry.py
test/unittest_changelog.py
test/unittest_registry.py
ureports/__init__.py
ureports/docbook_writer.py
# HG changeset patch
# User Rémi Cardona <remi.cardona@free.fr>
# Date 1406579224 -7200
# Mon Jul 28 22:27:04 2014 +0200
# Node ID 38c568b29cf301a2507454d48dfc202b6ceaef92
# Parent 521effbc6379f4fc1ced4f1fc3c35829ba4d94c0
Remove obsolete __future__ imports (related to #264017)

Generators have been available since 2.3, "with" statements since 2.6.

diff --git a/compat.py b/compat.py
@@ -24,11 +24,10 @@
1      :mod:`lib2to3.fixes`
2      :mod:`coverage.backward`
3      :mod:`unittest2.compatibility`
4  """
5 
6 -from __future__ import generators
7 
8  __docformat__ = "restructuredtext en"
9 
10  import os
11  import sys
diff --git a/modutils.py b/modutils.py
@@ -25,11 +25,10 @@
12  :var STD_LIB_DIR: directory where standard modules are located
13 
14  :type BUILTIN_MODULES: dict
15  :var BUILTIN_MODULES: dictionary with builtin module names has key
16  """
17 -from __future__ import with_statement
18 
19  __docformat__ = "restructuredtext en"
20 
21  import sys
22  import os
diff --git a/registry.py b/registry.py
@@ -867,13 +867,10 @@
23          >>> from logilab.common.registry import traced_selection
24          >>> with traced_selection():
25          ...     # some code in which you want to debug selectors
26          ...     # for all objects
27 
28 -    Don't forget the 'from __future__ import with_statement' at the module top-level
29 -    if you're using python prior to 2.6.
30 -
31      This will yield lines like this in the logs::
32 
33          selector one_line_rset returned 0 for <class 'elephant.Babar'>
34 
35      You can also give to :class:`traced_selection` the identifiers of objects on
diff --git a/test/unittest_changelog.py b/test/unittest_changelog.py
@@ -13,11 +13,10 @@
36  # FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more
37  # details.
38  #
39  # You should have received a copy of the GNU Lesser General Public License along
40  # with logilab-common.  If not, see <http://www.gnu.org/licenses/>.
41 -from __future__ import with_statement
42 
43  from os.path import join, dirname
44  from cStringIO import StringIO
45 
46  from logilab.common.testlib import TestCase, unittest_main
diff --git a/test/unittest_registry.py b/test/unittest_registry.py
@@ -14,11 +14,10 @@
47  # details.
48  #
49  # You should have received a copy of the GNU Lesser General Public License along
50  # with Logilab-Common.  If not, see <http://www.gnu.org/licenses/>.
51  """unit tests for selectors mechanism"""
52 -from __future__ import with_statement
53 
54  import gc
55  import logging
56  import os.path as osp
57  import sys
diff --git a/ureports/__init__.py b/ureports/__init__.py
@@ -18,11 +18,10 @@
58  """Universal report objects and some formatting drivers.
59 
60  A way to create simple reports using python objects, primarily designed to be
61  formatted as text and html.
62  """
63 -from __future__ import generators
64  __docformat__ = "restructuredtext en"
65 
66  import sys
67  from cStringIO import StringIO
68  from StringIO import StringIO as UStringIO
diff --git a/ureports/docbook_writer.py b/ureports/docbook_writer.py
@@ -14,11 +14,10 @@
69  # details.
70  #
71  # You should have received a copy of the GNU Lesser General Public License along
72  # with logilab-common.  If not, see <http://www.gnu.org/licenses/>.
73  """HTML formatting drivers for ureports"""
74 -from __future__ import generators
75  __docformat__ = "restructuredtext en"
76 
77  from logilab.common.ureports import HTMLWriter
78 
79  class DocbookWriter(HTMLWriter):