Skip to content

Commit 2fb0450

Browse files
cclausssatwikkansal
cclauss
authored andcommitted
Fix Python 3 compatibility in the irrelevant code! (satwikkansal#86)
1 parent 07861a0 commit 2fb0450

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

irrelevant/parse_readme.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,20 @@
22

33
"""
44
This inefficient module would parse the README.md in the initial version of
5-
WTFPython, and enabl me to categorize and reorder a hell lot of examples with
5+
WTFPython, and enable me to categorize and reorder a hell lot of examples with
66
the help of the file `add_categories` (part of which is automatically
77
generated).
88
99
After the refactor, this module would not work now with necessary updates in
1010
the code.
1111
"""
1212

13+
try:
14+
raw_input # Python 2
15+
except NameError:
16+
raw_input = input # Python 3
17+
18+
1319
fname = "README.md"
1420
snippets = []
1521

0 commit comments

Comments
 (0)