From 2fb04501f7919fd31a425457d0cfce52519a46e5 Mon Sep 17 00:00:00 2001 From: cclauss Date: Thu, 21 Jun 2018 21:47:51 +0200 Subject: [PATCH] Fix Python 3 compatibility in the irrelevant code! (#86) --- irrelevant/parse_readme.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/irrelevant/parse_readme.py b/irrelevant/parse_readme.py index 027acfd..1ad1da3 100644 --- a/irrelevant/parse_readme.py +++ b/irrelevant/parse_readme.py @@ -2,7 +2,7 @@ """ This inefficient module would parse the README.md in the initial version of -WTFPython, and enabl me to categorize and reorder a hell lot of examples with +WTFPython, and enable me to categorize and reorder a hell lot of examples with the help of the file `add_categories` (part of which is automatically generated). @@ -10,6 +10,12 @@ After the refactor, this module would not work now with necessary updates in the code. """ +try: + raw_input # Python 2 +except NameError: + raw_input = input # Python 3 + + fname = "README.md" snippets = []