00001 # -*- coding: utf-8 -*- 00002 # Copyright (c) 2012-2013 Raphaël Barrois 00003 # This code is distributed under the two-clause BSD License. 00004 00005 import sys 00006 00007 is_python2 = (sys.version_info[0] == 2) 00008 00009 if is_python2: # pragma: no cover 00010 base_cmp = cmp 00011 else: # pragma: no cover 00012 def base_cmp(x, y): 00013 if x < y: 00014 return -1 00015 elif x > y: 00016 return 1 00017 else: 00018 return 0