We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5ef4bba commit a306616Copy full SHA for a306616
1 file changed
extract_README.py
@@ -24,7 +24,11 @@
24
25
import inspect
26
import re
27
-import StringIO
+try:
28
+ from StringIO import StringIO ## for Python 2
29
+except ImportError:
30
+ from io import StringIO ## for Python 3
31
+
32
33
def dirmod():
34
r'''Same as dir(mod), but returns only functions, in the definition order'''
@@ -69,7 +73,7 @@ def write(s, verbatim):
69
73
70
74
prev_indented = False
71
75
72
- sio = StringIO.StringIO(s)
76
+ sio = StringIO(s)
77
for l in sio:
78
79
# handle links
0 commit comments