[pacman-dev] [PATCH v2 2/8] Use "exec" instead of "execfile" (deprecated in Python 3).

Jeremy Heiner scalaprotractor at gmail.com
Sat Oct 12 12:44:31 EDT 2013


This was the only compatibility issue reported by "python2 -3".

Signed-off-by: Jeremy Heiner <ScalaProtractor at gmail.com>
---
 test/pacman/pmtest.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index b343d55..d12a5ed 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -100,7 +100,8 @@ def load(self):
         if os.path.isfile(self.name):
             # all tests expect this to be available
             from pmpkg import pmpkg
-            execfile(self.name)
+            with open(self.name) as input:
+                exec(input.read(),locals())
         else:
             raise IOError("file %s does not exist!" % self.name)
 
-- 
1.8.4



More information about the pacman-dev mailing list