cms-nanoAOD/nanoAOD-tools

Add backwards compatibility broken by PR #251

camclean opened this issue · 3 comments

Line "from builtins import zip" added to several modules in PR #251 breaks workflows using python 2.7. If this line is actually necessary (I just commented it out in jetSmearer), please add workaround in code or to README. @Laurits7 @gouskos

I added this because this module is designed for code compatible on Python 2 and 3. Tested it with and without that line, works with both in python 2.7 for me, though I guess you got the errors along the lines that there is nomodule named builtins? For python 2 it should be installed, though at least CMSSW_10_2_10 it worked without any additional installation. Until (probably) nobody is using this with python3, I guess it can be commented out.

I'm using an older version (94X) of CMSSW (and I suspect that some older analyses that are finishing up will, too). I did in fact get the error saying no module named builtins. I would suggest adding something like the following lines:

import sys
if '2.' not in sys.version: from builtins import zip

this has been fixed in 255