1 # This library is free software; you can redistribute it and/or
2 # modify it under the terms of the GNU Lesser General Public
3 # License as published by the Free Software Foundation; either
4 # version 2.1 of the License, or (at your option) any later version.
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 if sys
.version_info
[0] == 2:
20 from StringIO
import StringIO
23 from UserList
import UserList
27 integer_types
= eval("(int, long)")
28 string_types
= eval("(basestring,)")
29 text_type
= eval("unicode")
31 reload = eval("reload")
32 xrange = eval("xrange")
35 exec("def reraise(tp, value, tb):\n raise tp, value, tb")
39 from io
import StringIO
42 from collections
import UserList
46 integer_types
= (int,)
50 from importlib
import reload
53 cmp = lambda a
, b
: (a
> b
) - (a
< b
)
55 def reraise(tp
, value
, tb
):
56 raise tp(value
).with_traceback(tb
)