From 5f3e8acab1ee92e35eaeba31e974701cb3e1ac27 Mon Sep 17 00:00:00 2001 From: Thomas Spura Date: Fri, 23 May 2014 13:26:26 +0200 Subject: [PATCH] add __future__.division/print_function to testfile as 2to3 strips it off --- python-tornado.spec | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/python-tornado.spec b/python-tornado.spec index 21ff451..8fa58ee 100644 --- a/python-tornado.spec +++ b/python-tornado.spec @@ -82,6 +82,17 @@ rm -rf %{py3dir} cp -a . %{py3dir} find %{py3dir} -name '*.py' | xargs sed -i '1s|^#!python|#!%{__python3}|' 2to3 --write --nobackups %{py3dir} +pushd %{py3dir} + # add __future__.division/print_function to testfile as 2to3 strips it off + mv tornado/test/template_test.py tornado/test/template_test.py.orig + echo "from __future__ import division" > tornado/test/template_test.py + cat tornado/test/template_test.py.orig >> tornado/test/template_test.py + touch -r tornado/test/template_test.py.orig tornado/test/template_test.py + mv tornado/test/util_test.py tornado/test/util_test.py.orig + echo "from __future__ import print_function" > tornado/test/util_test.py + cat tornado/test/util_test.py.orig >> tornado/test/util_test.py + touch -r tornado/test/util_test.py.orig tornado/test/util_test.py +popd %endif # with_python3 %build