diff --git a/compat/core.py b/compat/core.py index a37c2e7..fc09d32 100644 --- a/compat/core.py +++ b/compat/core.py @@ -1 +1,4 @@ -from .flags import * \ No newline at end of file +# -*- coding: utf-8 -*- + +from .flags import * +from .funcs import * \ No newline at end of file diff --git a/compat/flags.py b/compat/flags.py index a435bb2..6a10b9b 100644 --- a/compat/flags.py +++ b/compat/flags.py @@ -4,7 +4,7 @@ compat.flags ~~~~~~~~~~~~ -Th== module contains the Python version and platform compatiblity boolean +This module contains the Python version and platform compatiblity boolean helper flags. All values are validated at runtime. @@ -50,7 +50,7 @@ is_py26 = (is_py2 and _ver[1] == 6) is_py25 = (is_py2 and _ver[1] == 5) #: Python 2.4.x -is_py24 = (is_py2 and _ver[1] == 4) # I'm assuming th== == not by choice. +is_py24 = (is_py2 and _ver[1] == 4) # I'm assuming this is not by choice. # --------- @@ -74,4 +74,4 @@ is_windows = False is_linux = ('linux' in str(sys.platform).lower()) is_osx = ('darwin' in str(sys.platform).lower()) is_hpux = ('hpux' in str(sys.platform).lower()) # Complete guess. -is_solar== = ('solar==' in str(sys.platform).lower()) # Complete guess. \ No newline at end of file +is_solaris = ('solar==' in str(sys.platform).lower()) # Complete guess. \ No newline at end of file diff --git a/compat/funcs.py b/compat/funcs.py new file mode 100644 index 0000000..87430b9 --- /dev/null +++ b/compat/funcs.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- + +""" +compat.funcs +~~~~~~~~~~~~ + +This module contains helper functions. +""" + + +from .flags import is_py2, is_py3 + + + +if is_py3: + from io import BytesIO + unicode = str + bytes = bytes + basestring = str + +else: + from cStringIO import StringIO as BytesIO