Raise errors as instances of setup errors, not strings in order to provide
initial support for Python 3.0.
This commit is contained in:
parent
243849a5ff
commit
817186b16e
10
setup.py
10
setup.py
@ -114,14 +114,14 @@ if userOracleHome is not None:
|
|||||||
if not CheckOracleHome(userOracleHome):
|
if not CheckOracleHome(userOracleHome):
|
||||||
messageFormat = "Oracle home (%s) does not refer to an " \
|
messageFormat = "Oracle home (%s) does not refer to an " \
|
||||||
"9i, 10g or 11g installation."
|
"9i, 10g or 11g installation."
|
||||||
raise DistutilsSetupError, messageFormat % userOracleHome
|
raise DistutilsSetupError(messageFormat % userOracleHome)
|
||||||
else:
|
else:
|
||||||
for path in os.environ["PATH"].split(os.pathsep):
|
for path in os.environ["PATH"].split(os.pathsep):
|
||||||
if CheckOracleHome(path):
|
if CheckOracleHome(path):
|
||||||
break
|
break
|
||||||
if oracleHome is None:
|
if oracleHome is None:
|
||||||
raise DistutilsSetupError, "cannot locate an Oracle software " \
|
raise DistutilsSetupError("cannot locate an Oracle software " \
|
||||||
"installation"
|
"installation")
|
||||||
|
|
||||||
# define some variables
|
# define some variables
|
||||||
if sys.platform == "win32":
|
if sys.platform == "win32":
|
||||||
@ -133,7 +133,7 @@ if sys.platform == "win32":
|
|||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
includeDirs.append(path)
|
includeDirs.append(path)
|
||||||
if not includeDirs:
|
if not includeDirs:
|
||||||
raise DistutilsSetupError, "cannot locate Oracle include files"
|
raise DistutilsSetupError("cannot locate Oracle include files")
|
||||||
libs = ["oci"]
|
libs = ["oci"]
|
||||||
elif sys.platform == "cygwin":
|
elif sys.platform == "cygwin":
|
||||||
includeDirs = ["/usr/include", "rdbms/demo", "rdbms/public", \
|
includeDirs = ["/usr/include", "rdbms/demo", "rdbms/public", \
|
||||||
@ -159,7 +159,7 @@ else:
|
|||||||
if os.path.isdir(path):
|
if os.path.isdir(path):
|
||||||
includeDirs.append(path)
|
includeDirs.append(path)
|
||||||
if not includeDirs:
|
if not includeDirs:
|
||||||
raise DistutilsSetupError, "cannot locate Oracle include files"
|
raise DistutilsSetupError("cannot locate Oracle include files")
|
||||||
libPath = os.path.join(oracleHome, "lib")
|
libPath = os.path.join(oracleHome, "lib")
|
||||||
if sys.maxint == 2 ** 31 - 1:
|
if sys.maxint == 2 ** 31 - 1:
|
||||||
alternatePath = os.path.join(oracleHome, "lib32")
|
alternatePath = os.path.join(oracleHome, "lib32")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user