1. Joe Amenta
  2. lib3to2
Issue #28 new

Python 3’s default import behavior is not enforced when refactoring

Anonymous created an issue

Python 3 treats non-relative imports as absolute imports by default.

E.g. ‘from abc import ABCMeta’ in Python 3 will stop working in Python 2 if there’s a relative module called ‘abc.’

Fix: Python 3’s default behavior can be enforced in Python 2.5+ by adding ‘from future import absolute_import.’

Comments (1)

  1. Log in to comment