add trailing CR to the error message. use hasattr() rather than "in dir()"

git-svn-id: http://viewvc.tigris.org/svn/viewvc/trunk@139 8cb11bc2-c004-0410-86c3-e597b4017df7
remotes/tags/V0_6
gstein 2000-07-02 00:44:05 +00:00
parent 8996332950
commit 892364776e
1 changed files with 4 additions and 3 deletions

View File

@ -25,10 +25,11 @@ _no_datetime = """\
ERROR: Your version of MySQLdb requires the mxDateTime module
for the Timestamp() and TimestampFromTicks() methods.
You will need to install mxDateTime to use the ViewCVS
database."""
database.
"""
if "Timestamp" not in dir(MySQLdb) or \
"TimestampFromTicks" not in dir(MySQLdb):
if not hasattr(MySQLdb, "Timestamp") or \
not hasattr(MySQLdb, "TimestampFromTicks"):
sys.stderr.write(_no_datetime)
sys.exit(1)