Move pygi-convert.sh into tools
[pygobject.git] / tests / compathelper.py
blobd4f4d27c59e95802b85075c4fbd1f901c9611ce7
1 import sys
3 PY2 = PY3 = False
5 if sys.version_info >= (3, 0):
6 '''
7 for tests that need to test long values in python 2
9 python 3 does not differentiate between long and int
10 and does not supply a long keyword
12 instead of testing longs by using values such as 10L
13 test writters should do this:
15 from compathelper import _long
16 _long(10)
17 '''
18 _long = int
20 '''
21 for tests that need to test string values in python 2
23 python 3 does differentiate between str and bytes
24 and does not supply a basestring keyword
26 any tests that use basestring should do this:
28 from compathelper import _basestring
29 isinstance(_basestring, "hello")
30 '''
31 _basestring = str
33 from io import StringIO
34 StringIO
35 PY3 = True
36 else:
37 _long = long
38 _basestring = basestring
39 from StringIO import StringIO
40 StringIO
41 PY2 = True