From ce780493ad84cc10976034bfb4349b9cd2152833 Mon Sep 17 00:00:00 2001
From: Anand Gadiyar <gadiyar@ti.com>
Date: Fri, 5 Apr 2013 16:47:46 +0530
Subject: [PATCH] import sys as something else to avoid namespace conflicts

With cxfreeze, trying to freeze an application that uses scipy and numpy,
I ran into the following error.

Traceback (most recent call last):
File "D:\Python27\lib\site-packages\cx_Freeze\initscripts\Console.py", line 27, in <module>
exec_code in m.__dict__
File "mSimpleGui.py", line 10, in <module>
File "mSystem.py", line 7, in <module>
File "D:\Python27\lib\site-packages\scipy\__init__.py", line 64, in <module>
	from numpy import show_config as show_numpy_config
File "D:\Python27\lib\site-packages\numpy\__init__.py", line 165, in <module>
	from core import *
AttributeError: 'module' object has no attribute 'sys'

The patch below fixes this for me.
---
 numpy/core/__init__.py |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/numpy/core/__init__.py b/numpy/core/__init__.py
index 5d15991..a77bc04 100644
--- a/numpy/core/__init__.py
+++ b/numpy/core/__init__.py
@@ -60,8 +60,8 @@ def _ufunc_reduce(func):
     return _ufunc_reconstruct, (whichmodule(func,name), name)
 
 
-import sys
-if sys.version_info[0] < 3:
+import sys as mysys
+if mysys.version_info[0] < 3:
     import copy_reg as copyreg
 else:
     import copyreg
@@ -69,5 +69,5 @@ else:
 copyreg.pickle(ufunc, _ufunc_reduce, _ufunc_reconstruct)
 # Unclutter namespace (must keep _ufunc_reconstruct for unpickling)
 del copyreg
-del sys
+del mysys
 del _ufunc_reduce
-- 
1.7.9.5

