diff --git a/.travis.yml b/.travis.yml
index 419cb0e..64bedd8 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,9 @@ python:
   - 3.6
   - pypy
   - pypy3.3-5.2-alpha1
+matrix:
+  allow_failures:
+  - python: 2.6
 cache: pip
 install:
   - pip install tox-travis
diff --git a/astor/__init__.py b/astor/__init__.py
index de48a5c..bb96de4 100644
--- a/astor/__init__.py
+++ b/astor/__init__.py
@@ -19,7 +19,7 @@ from .op_util import get_op_symbol, get_op_precedence  # NOQA
 from .op_util import symbol_data  # NOQA
 from .tree_walk import TreeWalk  # NOQA
 
-__version__ = '0.6.1'
+__version__ = '0.6.2'
 
 parse_file = code_to_ast.parse_file
 
@@ -34,6 +34,7 @@ codetoast = code_to_ast
 dump = dump_tree
 all_symbols = symbol_data
 treewalk = tree_walk
+codegen = code_gen
 """
 
 exec(deprecated)
diff --git a/docs/changelog.rst b/docs/changelog.rst
index fb259ff..54bc9b7 100644
--- a/docs/changelog.rst
+++ b/docs/changelog.rst
@@ -2,6 +2,25 @@
 Release Notes
 =============
 
+0.6.2 - 2017-11-11
+------------------
+
+Bug fixes
+---------
+
+* Restore backwards compatibility that was broken after 0.6.1.
+  You can now continue to use the following pattern::
+
+     import astor
+
+     class SpamCodeGenerator(astor.codegen.SourceGenerator):
+         ...
+
+  (Reported by Dan Moldovan and fixed by Berker Peksag in `Issue 87`_.)
+
+.. _`Issue 87`: https://github.com/berkerpeksag/astor/issues/87
+
+
 0.6.1 - 2017-11-11
 ------------------
 
diff --git a/tox.ini b/tox.ini
index 5f8e1ae..5149f5c 100644
--- a/tox.ini
+++ b/tox.ini
@@ -4,7 +4,7 @@ skipsdist = True
 
 [testenv]
 usedevelop = True
-commands = nosetests -v
+commands = nosetests -v --nocapture {posargs}
 deps =
  -rrequirements-tox.txt
  py2{6,7},pypy: unittest2

Suspected API breakage from 0.6 to 0.6.1
Hi, our builds started failing with `AttributeError: module 'astor' has no attribute 'codegen'`:

https://travis-ci.org/google/tangent/jobs/300437272

I wonder if it's related to the new 0.6.1 release?
diff --git a/tests/support.py b/tests/support.py
new file mode 100644
index 0000000..db8c4ea
--- /dev/null
+++ b/tests/support.py
@@ -0,0 +1,44 @@
+import importlib
+import sys
+
+
+def _save_and_remove_module(name, orig_modules):
+    """Helper function to save and remove a module from sys.modules
+    Raise ImportError if the module can't be imported.
+    """
+    # try to import the module and raise an error if it can't be imported
+    if name not in sys.modules:
+        __import__(name)
+        del sys.modules[name]
+    for modname in list(sys.modules):
+        if modname == name or modname.startswith(name + '.'):
+            orig_modules[modname] = sys.modules[modname]
+            del sys.modules[modname]
+
+
+def import_fresh_module(name, fresh=(), blocked=()):
+    """Import and return a module, deliberately bypassing sys.modules.
+
+    This function imports and returns a fresh copy of the named Python module
+    by removing the named module from sys.modules before doing the import.
+    Note that unlike reload, the original module is not affected by
+    this operation.
+    """
+    orig_modules = {}
+    names_to_remove = []
+    _save_and_remove_module(name, orig_modules)
+    try:
+        for fresh_name in fresh:
+            _save_and_remove_module(fresh_name, orig_modules)
+        for blocked_name in blocked:
+            if not _save_and_block_module(blocked_name, orig_modules):
+                names_to_remove.append(blocked_name)
+        fresh_module = importlib.import_module(name)
+    except ImportError:
+        fresh_module = None
+    finally:
+        for orig_name, module in orig_modules.items():
+            sys.modules[orig_name] = module
+        for name_to_remove in names_to_remove:
+            del sys.modules[name_to_remove]
+    return fresh_module
diff --git a/tests/test_misc.py b/tests/test_misc.py
index 983de40..7a7f5a4 100644
--- a/tests/test_misc.py
+++ b/tests/test_misc.py
@@ -8,6 +8,8 @@ except ImportError:
 
 import astor
 
+from .support import import_fresh_module
+
 
 class GetSymbolTestCase(unittest.TestCase):
 
@@ -22,16 +24,27 @@ class PublicAPITestCase(unittest.TestCase):
     def test_aliases(self):
         self.assertIs(astor.parse_file, astor.code_to_ast.parse_file)
 
-
-class DeprecationTestCase(unittest.TestCase):
-
-    def test_deprecate_parsefile(self):
-        with self.assertWarns(DeprecationWarning):
-            astor.parsefile(__file__)
-
-    def test_deprecate_astor_codegen(self):
-        with self.assertWarns(DeprecationWarning):
+    def test_codegen_from_root(self):
+        with self.assertWarns(DeprecationWarning) as cm:
+            astor = import_fresh_module('astor')
+            astor.codegen.SourceGenerator
+        self.assertEqual(len(cm.warnings), 1)
+        # This message comes from 'astor/__init__.py'.
+        self.assertEqual(
+            str(cm.warnings[0].message),
+            'astor.codegen is deprecated.  Please use astor.code_gen.'
+        )
+
+    def test_codegen_as_submodule(self):
+        with self.assertWarns(DeprecationWarning) as cm:
             import astor.codegen
+        self.assertEqual(len(cm.warnings), 1)
+        # This message comes from 'astor/codegen.py'.
+        self.assertEqual(
+            str(cm.warnings[0].message),
+            'astor.codegen module is deprecated. Please import '
+            'astor.code_gen module instead.'
+        )
 
 
 class FastCompareTestCase(unittest.TestCase):

pip install -e .
parse_log_pytest
pytest
nose pytest
3.6
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
-e git+https://github.com/berkerpeksag/astor.git@abdd707e215d57178aae5ea2dd7a8ffe327ef272#egg=astor
attrs @ file:///opt/conda/conda-bld/attrs_1642510447205/work
certifi==2021.5.30
importlib-metadata @ file:///tmp/build/80754af9/importlib-metadata_1631916693255/work
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
more-itertools @ file:///tmp/build/80754af9/more-itertools_1637733554872/work
nose==1.3.7
packaging @ file:///tmp/build/80754af9/packaging_1637314298585/work
pluggy @ file:///tmp/build/80754af9/pluggy_1615976315926/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pyparsing @ file:///tmp/build/80754af9/pyparsing_1635766073266/work
pytest==6.2.4
toml @ file:///tmp/build/80754af9/toml_1616166611790/work
typing_extensions @ file:///opt/conda/conda-bld/typing_extensions_1647553014482/work
zipp @ file:///tmp/build/80754af9/zipp_1633618647012/work

name: astor
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=21.4.0=pyhd3eb1b0_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - importlib-metadata=4.8.1=py36h06a4308_0
  - importlib_metadata=4.8.1=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - more-itertools=8.12.0=pyhd3eb1b0_0
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=21.3=pyhd3eb1b0_0
  - pip=21.2.2=py36h06a4308_0
  - pluggy=0.13.1=py36h06a4308_0
  - py=1.11.0=pyhd3eb1b0_0
  - pyparsing=3.0.4=pyhd3eb1b0_0
  - pytest=6.2.4=py36h06a4308_2
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - toml=0.10.2=pyhd3eb1b0_0
  - typing_extensions=4.1.1=pyh06a4308_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.6.0=pyhd3eb1b0_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - nose==1.3.7
prefix: /opt/conda/envs/astor

tests/test_misc.py::PublicAPITestCase::test_codegen_from_root
tests/test_misc.py::GetSymbolTestCase::test_get_mat_mult tests/test_misc.py::PublicAPITestCase::test_aliases tests/test_misc.py::PublicAPITestCase::test_codegen_as_submodule tests/test_misc.py::FastCompareTestCase::test_fast_compare
.travis.yml tox.ini docs/changelog.rst astor/__init__.py
.travis.yml tox.ini docs/changelog.rst astor/__init__.py