Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

support both Python 2 and 3

  • Loading branch information...
commit baeb1ad3bc2b63d39b66665260d5421a86590cd2 1 parent 3ae609b
@sublee authored
Showing with 8 additions and 3 deletions.
  1. +3 −1 rainbow
  2. +5 −2 setup.py
View
4 rainbow
@@ -442,9 +442,11 @@ def main():
else:
logger.info("No arguments given, using STDIN as input.")
+ # Support both Python 2 and 3.
+ input_ = raw_input if sys.version_info[0] < 3 else input
try:
while True:
- print(apply_filters(raw_input()))
+ print(apply_filters(input_()))
except (EOFError, KeyboardInterrupt):
return 0
finally:
View
7 setup.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
-import os, glob
from distutils.core import setup
+import glob
+import os
setup(
name = "rainbow",
@@ -24,6 +25,8 @@
"Intended Audience :: System Administrators",
"Natural Language :: English",
"Programming Language :: Python",
+ "Programming Language :: Python :: 2",
+ "Programming Language :: Python :: 3",
"License :: OSI Approved :: GNU General Public License (GPL)",
],
scripts=['rainbow'],
@@ -31,5 +34,5 @@
('/usr/share/rainbow/configs', glob.glob('configs/*')),
('/etc/bash_completion.d', ['completion/bash/rainbow']),
('/usr/share/zsh/site-functions', ['completion/zsh/_rainbow'])
- ]
+ ],
)
Please sign in to comment.
Something went wrong with that request. Please try again.