0001-use-exec-in-py3-compatible-manner.patch 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. From 5de1bb82465d39962e26175c62f644a3e423d030 Mon Sep 17 00:00:00 2001
  2. From: Adam Williamson <awilliam@redhat.com>
  3. Date: Thu, 21 Jan 2016 17:21:52 -0800
  4. Subject: [PATCH] use 'exec' in py3-compatible manner
  5. per https://docs.python.org/2/reference/simple_stmts.html ,
  6. as exec is a function not a statement in py3, the py2 version
  7. has been set to allow the subsequent statement to be a tuple,
  8. so we can invoke it like this to make it both py2 and py3
  9. compatible. Without this, byte-compiling the file fails under
  10. py3.
  11. Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
  12. ---
  13. downloaded from upstream commit:
  14. https://github.com/mwclient/mwclient/commit/5de1bb82465d39962e26175c62f644a3e423d030
  15. mwclient/ex.py | 2 +-
  16. 1 file changed, 1 insertion(+), 1 deletion(-)
  17. diff --git a/mwclient/ex.py b/mwclient/ex.py
  18. index db4006c..c0b1eae 100644
  19. --- a/mwclient/ex.py
  20. +++ b/mwclient/ex.py
  21. @@ -12,7 +12,7 @@ def read_config(config_files, **predata):
  22. def _read_config_file(_config_file, predata):
  23. _file = open(_config_file)
  24. - exec _file in globals(), predata
  25. + exec(_file, globals(), predata)
  26. _file.close()
  27. for _k, _v in predata.iteritems():
  28. --
  29. 2.9.3