mailr24391 - /trunk/lib/compat.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 02, 2014 - 09:42:
Author: bugman
Date: Wed Jul  2 09:42:01 2014
New Revision: 24391

URL: http://svn.gna.org/viewcvs/relax?rev=24391&view=rev
Log:
Removed the lib.compat.sorted() function which was providing Python2.3 
compatibility.

For a while now, relax has been unable to run on Python versions less than 
2.5.  Therefore there is
no use for having this replacement function for Python <= 2.3 which was being 
placed into the
builtins module.


Modified:
    trunk/lib/compat.py

Modified: trunk/lib/compat.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/lib/compat.py?rev=24391&r1=24390&r2=24391&view=diff
==============================================================================
--- trunk/lib/compat.py (original)
+++ trunk/lib/compat.py Wed Jul  2 09:42:01 2014
@@ -247,19 +247,6 @@
 
     # Support for older version (this is much slower).
     return numpy.apply_along_axis(numpy.linalg.norm, axis, x)
-
-
-def sorted(data):
-    """Python 2.3 and earlier replacement function for the builtin sorted() 
function."""
-
-    # Make a copy of the data.
-    new_data = deepcopy(data)
-
-    # Sort.
-    new_data.sort()
-
-    # Return the new data.
-    return new_data
 
 
 
@@ -374,10 +361,6 @@
     # This should work as all range() usage for Python 3 in relax must match 
the old xrange() usage.
     #builtins.range = builtins.xrange
 
-    # The sorted() builtin function for Python 2.3 and earlier.
-    if sys.version_info[1] <= 3:
-        setattr(builtins, 'sorted', sorted)
-
     # The os.devnull object for Python 2.3 and earlier.
     if sys.version_info[1] <= 3:
         if SYSTEM == 'Linux':




Related Messages


Powered by MHonArc, Updated Wed Jul 02 10:00:02 2014