diff -dur Python-2.7.10.orig/Lib/distutils/command/bdist_rpm.py Python-2.7.10/Lib/distutils/command/bdist_rpm.py
--- Python-2.7.10.orig/Lib/distutils/command/bdist_rpm.py 2015-05-23 18:09:01.000000000 +0200
-+++ Python-2.7.10/Lib/distutils/command/bdist_rpm.py 2015-12-02 21:32:28.137323794 +0100
++++ Python-2.7.10/Lib/distutils/command/bdist_rpm.py 2015-12-03 09:23:08.000000000 +0100
@@ -338,6 +338,16 @@
if self.rpm3_mode:
rpm_cmd.extend(['--define',
q_cmd = r"rpm -q --qf '%s %s\n' --specfile '%s'" % (
src_rpm, non_src_rpm, spec_path)
+diff -dur Python-2.7.10.orig/Lib/distutils/tests/test_bdist_rpm.py Python-2.7.10/Lib/distutils/tests/test_bdist_rpm.py
+--- Python-2.7.10.orig/Lib/distutils/tests/test_bdist_rpm.py 2015-05-23 18:09:02.000000000 +0200
++++ Python-2.7.10/Lib/distutils/tests/test_bdist_rpm.py 2015-12-03 09:24:55.000000000 +0100
+@@ -48,6 +48,8 @@
+ 'the rpm command is not found')
+ @unittest.skipIf(find_executable('rpmbuild') is None,
+ 'the rpmbuild command is not found')
++ @unittest.skipIf(os.environ.get("WITHIN_PYTHON_RPM_BUILD"),
++ 'building the python rpm')
+ def test_quiet(self):
+ # let's create a package
+ tmp_dir = self.mkdtemp()
+@@ -91,6 +93,8 @@
+ 'the rpm command is not found')
+ @unittest.skipIf(find_executable('rpmbuild') is None,
+ 'the rpmbuild command is not found')
++ @unittest.skipIf(os.environ.get("WITHIN_PYTHON_RPM_BUILD"),
++ 'building the python rpm')
+ def test_no_optimize_flag(self):
+ # let's create a package that brakes bdist_rpm
+ tmp_dir = self.mkdtemp()