From 8ae50d7dbfce81cdd8fa01694ed397062f801a0d Mon Sep 17 00:00:00 2001 From: Orion Poplawski Date: Wed, 28 Jan 2015 13:11:12 -0700 Subject: [PATCH] Add py3 patch --- environment-modules-py3-and-doc-fix.patch | 27 +++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 environment-modules-py3-and-doc-fix.patch diff --git a/environment-modules-py3-and-doc-fix.patch b/environment-modules-py3-and-doc-fix.patch new file mode 100644 index 0000000..ded76d9 --- /dev/null +++ b/environment-modules-py3-and-doc-fix.patch @@ -0,0 +1,27 @@ +diff -up modules-3.2.10/doc/module.1.in.py3 modules-3.2.10/doc/module.1.in +--- modules-3.2.10/doc/module.1.in.py3 2015-01-28 09:55:01.172781681 -0700 ++++ modules-3.2.10/doc/module.1.in 2015-01-28 09:55:51.045510021 -0700 +@@ -107,11 +107,8 @@ And the python + .I module + command is defined with: + +- import os; +- if os.environ.has_key('PYTHONPATH'): +- os.environ['PYTHONPATH'] +=':'+os.environ['MODULESHOME']+"/init"; +- else: +- os.environ['PYTHONPATH'] = os.environ['MODULESHOME']+"/init"; ++ import os, sys; ++ sys.path.insert(0, '@INITPATH@') + + from python import module; + +diff -up modules-3.2.10/init/python.py.in.py3 modules-3.2.10/init/python.py.in +--- modules-3.2.10/init/python.py.in.py3 2015-01-28 09:55:01.173781675 -0700 ++++ modules-3.2.10/init/python.py.in 2015-01-28 09:56:08.570414569 -0700 +@@ -27,5 +27,5 @@ def module(*args): + @VERSIONING@ (output, error) = subprocess.Popen(['@BASEPREFIX@/Modules/%s/bin/modulecmd' % os.environ['MODULE_VERSION'], 'python'] + + @NOTVERSIONING@ (output, error) = subprocess.Popen(['@bindir@/modulecmd', 'python'] + + args, stdout=subprocess.PIPE).communicate() +- exec output ++ exec(output) +