diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2009-10-19 10:30:48 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2009-10-19 10:30:48 +0300 |
commit | 63175d4d31469816c575ddb4de9698fb5c053536 (patch) | |
tree | 45fdb611b577c4d3e47a5578cc309dc569ba4ad4 /scripts | |
parent | 9707b5478bbad7251810247b2383f91b5bbabc16 (diff) | |
download | rpm-63175d4d31469816c575ddb4de9698fb5c053536.tar.gz rpm-63175d4d31469816c575ddb4de9698fb5c053536.tar.bz2 rpm-63175d4d31469816c575ddb4de9698fb5c053536.zip |
Avoid using python's print for Python 3.x compatibility
- print chanced from statement to a function in python 3, for our
purposes sys.stdout.write() is sufficient and avoids dealing with
the incompatibilities between Python 2.x and 3.x
- suggested by David Malcolm / Ville Skyttä
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/macros.python.in | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/macros.python.in b/scripts/macros.python.in index c7832a67a..ea1f200fc 100644 --- a/scripts/macros.python.in +++ b/scripts/macros.python.in @@ -3,10 +3,10 @@ # %include %{_rpmconfigdir}/macros.python # python main version -%define py_ver %(echo `python -c "import sys; print sys.version[:3]"`) +%define py_ver %(echo `python -c "import sys; sys.stdout.write(sys.version[:3])"`) # directories -%define py_prefix %(echo `python -c "import sys; print sys.prefix"`) +%define py_prefix %(echo `python -c "import sys; sys.stdout.write(sys.prefix)"`) %define py_libdir %{py_prefix}/lib/python%{py_ver} %define py_incdir /usr/include/python%{py_ver} %define py_sitedir %{py_libdir}/site-packages |