Ignore:
Timestamp:
01/06/16 22:46:37 (4 years ago)
Author:
mjuckes
Message:

python version tolerance

File:
1 edited

Legend:

Unmodified
Added
Removed
  • CMIP6dreqbuild/trunk/src/framework/dreqPy/makeTables.py

    r669 r670  
    1313    else: 
    1414      return -1 
    15 from functools import cmp_to_key 
     15 
     16if sys.version_info >= (2,7): 
     17  from functools import cmp_to_key 
     18  oldpython = False 
     19else: 
     20  oldpython = True 
    1621 
    1722import scope_utils 
     
    114119 
    115120 
    116 kAnnex = cmp_to_key( cmpAnnex ) 
     121if not oldpython: 
     122  kAnnex = cmp_to_key( cmpAnnex ) 
    117123 
    118124import re 
     
    137143    else: 
    138144      cmv = dq.coll['CMORvar'].items 
    139     ##tables = sorted( list( set( [i.mipTable for i in cmv] ) ), cmp=cmpAnnex ) 
    140     tables = sorted( list( set( [i.mipTable for i in cmv] ) ), key=kAnnex ) 
     145    if oldpython: 
     146      tables = sorted( list( set( [i.mipTable for i in cmv] ) ), cmp=cmpAnnex ) 
     147    else: 
     148      tables = sorted( list( set( [i.mipTable for i in cmv] ) ), key=kAnnex ) 
    141149 
    142150    addMips = True 
Note: See TracChangeset for help on using the changeset viewer.