You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
646 B
26 lines
646 B
from __future__ import print_function, unicode_literals, absolute_import
|
|
import sys
|
|
|
|
if sys.version_info[0] >= 3:
|
|
import collections
|
|
PY3 = True
|
|
def callable(x):
|
|
return isinstance(x, collections.Callable)
|
|
|
|
def execfile(fname, glob, loc=None):
|
|
loc = loc if (loc is not None) else glob
|
|
with open(fname) as fil:
|
|
txt = fil.read()
|
|
exec(compile(txt, fname, 'exec'), glob, loc)
|
|
|
|
unicode = str
|
|
bytes = bytes
|
|
from io import StringIO
|
|
else:
|
|
PY3 = False
|
|
callable = callable
|
|
execfile = execfile
|
|
bytes = str
|
|
unicode = unicode
|
|
|
|
from StringIO import StringIO
|