python2 compatibility if command not found or permission denied

This commit is contained in:
Radovan Garabík 2017-04-23 13:26:44 +02:00
parent 5da88f5bcc
commit 987fb4ce98
1 changed files with 14 additions and 2 deletions

16
grc
View File

@ -4,13 +4,25 @@ from __future__ import print_function
import os, re, string, sys, getopt, signal
# python 2/3 compatibility
try:
FileNotFoundError
except NameError:
FileNotFoundError = OSError
try:
PermissionError
except NameError:
PermissionError = OSError
def version():
print ("Generic Colouriser 1.11")
print ("Generic Colouriser 1.11.1rc")
sys.exit()
def help():
print("""Generic Colouriser 1.11
print("""Generic Colouriser 1.11.1rc
grc [options] command [args]
Options:
-e --stderr redirect stderr. If this option is selected,