Message104008
Lines such as the following are removed by fix_future.py in 2to3
from __future__ import absolute_import, unicode_literals
I think this is unnecessary and I have a case where it causes problems. It's unnecessary because this import is essentially a no-op in Python 3, so it does no harm, and serves no actual useful purpose to remove. It causes harm because of a common idiom in doctest setups:
def setup(testobj):
"""Test setup."""
# Make sure future statements in our doctests match the Python code.
testobj.globs['absolute_import'] = absolute_import
testobj.globs['unicode_literals'] = unicode_literals
fix_future.py removes the import so these cause NameErrors. Sure, I can wrap them in try/excepts, but still what's the point of fix_future? |
|
Date |
User |
Action |
Args |
2010-04-23 12:31:15 | barry | set | recipients:
+ barry |
2010-04-23 12:31:15 | barry | set | messageid: <1272025875.68.0.994022757539.issue8505@psf.upfronthosting.co.za> |
2010-04-23 12:31:14 | barry | link | issue8505 messages |
2010-04-23 12:31:13 | barry | create | |
|