diff --git a/edk2.spec b/edk2.spec
index 9bf6036..0c90153 100644
--- a/edk2.spec
+++ b/edk2.spec
@@ -393,7 +393,9 @@ install BaseTools/Scripts/GccBase.lds \
         %{buildroot}%{_datadir}/%{name}/Scripts
 
 cp -R BaseTools/Source/Python %{buildroot}%{_datadir}/%{name}/Python
+%if 0%{?fedora} >= 29
 %py_byte_compile %{__python2} %{buildroot}%{_datadir}/%{name}/Python
+%endif
 for i in build BPDG Ecc GenDepex GenFds GenPatchPcdTable PatchPcdValue TargetTool Trim UPT; do
 echo '#!/bin/sh
 export PYTHONPATH=%{_datadir}/%{name}/Python