c836458
From 5de1bb82465d39962e26175c62f644a3e423d030 Mon Sep 17 00:00:00 2001
c836458
From: Adam Williamson <awilliam@redhat.com>
c836458
Date: Thu, 21 Jan 2016 17:21:52 -0800
c836458
Subject: [PATCH] use 'exec' in py3-compatible manner
c836458
c836458
per https://docs.python.org/2/reference/simple_stmts.html ,
c836458
as exec is a function not a statement in py3, the py2 version
c836458
has been set to allow the subsequent statement to be a tuple,
c836458
so we can invoke it like this to make it both py2 and py3
c836458
compatible. Without this, byte-compiling the file fails under
c836458
py3.
c836458
---
c836458
 mwclient/ex.py | 2 +-
c836458
 1 file changed, 1 insertion(+), 1 deletion(-)
c836458
c836458
diff --git a/mwclient/ex.py b/mwclient/ex.py
c836458
index db4006c..c0b1eae 100644
c836458
--- a/mwclient/ex.py
c836458
+++ b/mwclient/ex.py
c836458
@@ -12,7 +12,7 @@ def read_config(config_files, **predata):
c836458
 
c836458
 def _read_config_file(_config_file, predata):
c836458
     _file = open(_config_file)
c836458
-    exec _file in globals(), predata
c836458
+    exec(_file, globals(), predata)
c836458
     _file.close()
c836458
 
c836458
     for _k, _v in predata.iteritems():
c836458
-- 
c836458
2.7.0
c836458