projects
/
services
/
python-requests.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b82e72e
)
cstring io fix for py3
author
Kenneth Reitz
<me@kennethreitz.com>
Fri, 18 Feb 2011 21:08:26 +0000
(16:08 -0500)
committer
Kenneth Reitz
<me@kennethreitz.com>
Fri, 18 Feb 2011 21:08:26 +0000
(16:08 -0500)
test_requests.py
patch
|
blob
|
history
diff --git
a/test_requests.py
b/test_requests.py
index
963abbc
..
a45f5cb
100644
(file)
--- a/
test_requests.py
+++ b/
test_requests.py
@@
-1,12
+1,16
@@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import sys
import unittest
-try:
- from cStringIO import StringIO
-except ImportError:
- from StringIO import StringIO
+if sys.version_info >= (3,0):
+ from io import StringIO
+else:
+ try:
+ from cStringIO import StringIO
+ except ImportError:
+ from StringIO import StringIO
import requests