Skip to content

Commit 62c9242

Browse files
committed
Remove hacks for no longer supported Py versiions
Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
1 parent 3b32a74 commit 62c9242

File tree

2 files changed

+1
-25
lines changed

2 files changed

+1
-25
lines changed

run_demo.py

-5
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66
import time
77
from shutil import copyfile, copytree, rmtree
88

9-
try:
10-
input = raw_input
11-
except NameError:
12-
pass
13-
149
NO_PROMPT = False
1510

1611
def prompt_key(prompt):

run_demo_md.py

+1-20
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,8 @@
2626
import shutil
2727
import sys
2828
import tempfile
29-
import six
3029
import difflib
31-
32-
if six.PY2:
33-
import subprocess32 as subprocess
34-
else:
35-
import subprocess
30+
import subprocess
3631

3732
# The file pointed to by `INSTRUCTIONS_FN` contains `shell` code snippets that
3833
# may be extracted using the regex defined in `SNIPPET_PATTERN`, and executed
@@ -80,11 +75,6 @@
8075
1
8176
"""
8277

83-
# NOTE: Very ugly hack to make this work on Python 2
84-
if six.PY2:
85-
EXPECTED_STDOUT = EXPECTED_STDOUT.replace("['", "[u'")
86-
87-
8878
# Setup a test directory with all necessary demo files and change into it. This
8979
# lets us easily clean up all the files created during the demo eventually.
9080
demo_dir = os.path.dirname(os.path.realpath(__file__))
@@ -113,15 +103,6 @@
113103
universal_newlines=True)
114104
stdout, _ = proc.communicate()
115105

116-
# NOTE: Ugly hack to filter deprecation warnings from output on EOLed versions
117-
if sys.version_info < (3, 6):
118-
stdout_filtered_list = []
119-
for line in stdout.split("\n"):
120-
if ("import cryptography.exceptions" not in line and
121-
"CryptographyDeprecationWarning" not in line):
122-
stdout_filtered_list.append(line)
123-
stdout = "\n".join(stdout_filtered_list)
124-
125106
# Fail if the output is not what we expected
126107
if stdout != EXPECTED_STDOUT:
127108
difflist = list(difflib.Differ().compare(

0 commit comments

Comments
 (0)