Package proton :: Module _compat
[frames] | no frames]

Module _compat

source code

Utilities to help Proton support both python2 and python3.

Functions
 
raise_(t, v=None, tb=None)
Mimic the old 2.x raise behavior: Raise an exception of type t with value v using optional traceback tb
source code
 
iteritems(d, **kw) source code
 
unichar(i) source code
 
str2bin(s, encoding='latin-1') source code
 
str2unicode(s) source code
Variables
  IS_PY2 = sys.version_info [0]== 2
  IS_PY3 = sys.version_info [0]== 3
  INT_TYPES = int, long
  TEXT_TYPES = unicode,
  STRING_TYPES = basestring,
  BINARY_TYPES = str,
  CLASS_TYPES = type, types.ClassType