Created
March 26, 2012 09:51
-
-
Save takluyver/2204230 to your computer and use it in GitHub Desktop.
rpy2 setup.py change for Python 3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r_exec = os.path.join(r_home, 'bin', 'R') | |
# Changed --------------------------------------- | |
import subprocess | |
rp = subprocess.check_output([r_exec, '--version'], stderr=subprocess.STDOUT).decode('ascii').splitlines() | |
rversion = rp[0] | |
# Twist if 'R RHOME' spits out a warning | |
if rversion.startswith("WARNING"): | |
rversion = rp[1] | |
# End of changed section ------------------------ | |
m = re.match('^R ([^ ]+) ([^ ]+) .+$', rversion) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment