From 93fb7c39181bf6667ecc384694f6ed624e5377e8 Mon Sep 17 00:00:00 2001 From: Jim Witschey Date: Wed, 5 Apr 2017 14:00:35 -0400 Subject: [PATCH] fix py3 syntax errors in setup.py Before this commit, attempted installation under Python 3 resulted in ``` $ pip install . Processing /home/mambocab/cstar_src/ssl Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-i70f75bv-build/setup.py", line 33 print 'looking for', f ^ SyntaxError: Missing parentheses in call to 'print' ---------------------------------------- ``` After it, attempted installation under Python 3 is the same as under Python 2.6.0+: ``` $ pip install . Processing /home/mambocab/cstar_src/ssl Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in File "/tmp/pip-149_ydsx-build/setup.py", line 14, in + "or earlier.") ValueError: This extension should not be used with Python 2.6 or later (already built in), and has not been tested with Python 2.3.4 or earlier. ---------------------------------------- ``` --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e7c60e0..8d4b6d9 100644 --- a/setup.py +++ b/setup.py @@ -1,3 +1,5 @@ +from __future__ import print_function + import codecs import os import re @@ -30,14 +32,14 @@ def find_file(filename, std_dirs, paths): # Check the standard locations for dir in std_dirs: f = os.path.join(dir, filename) - print 'looking for', f + print('looking for', f) if os.path.exists(f): return [] # Check the additional directories for dir in paths: f = os.path.join(dir, filename) - print 'looking for', f + print('looking for', f) if os.path.exists(f): return [dir]