diff --git a/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/PrunDriver.cxx b/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/PrunDriver.cxx
index 11b2ece3b3c0eea0c9f57d63b1f99989cf635b75..24ee3132d3a68a67533a3953adc3047571da581f 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/PrunDriver.cxx
+++ b/PhysicsAnalysis/D3PDTools/EventLoopGrid/Root/PrunDriver.cxx
@@ -370,7 +370,7 @@ static std::string formatOutputName(const SH::MetaObject& sampleMeta,
   static const std::string nickname = 
     gSystem->GetFromPipe(Form("python -c \"%s\" 2>/dev/null", 
 			      "from pandatools import PsubUtils;"
-			      "print PsubUtils.getNickname();")).Data();
+			      "print(PsubUtils.getNickname());")).Data();
     
   TString out = pattern.c_str();
 
diff --git a/PhysicsAnalysis/D3PDTools/EventLoopGrid/data/ELG_prun.py b/PhysicsAnalysis/D3PDTools/EventLoopGrid/data/ELG_prun.py
index 914e0091591afc4f80850467086cfc2c2a4bce2e..c82a27b240b495e8125e9df6137f5b4acb1dce25 100644
--- a/PhysicsAnalysis/D3PDTools/EventLoopGrid/data/ELG_prun.py
+++ b/PhysicsAnalysis/D3PDTools/EventLoopGrid/data/ELG_prun.py
@@ -127,7 +127,7 @@ def ELG_prun(sample) :
 
     jediTaskID = 0
     try:
-        line = re.findall(r'TaskID=\d+', out)[0]
+        line = re.findall(r'TaskID=\d+', str(out))[0]
         jediTaskID = int(re.findall(r'\d+', line)[0])
     except IndexError:
         print (out)