From 892364776e264309a02a5e812444b425b3121ba5 Mon Sep 17 00:00:00 2001 From: gstein Date: Sun, 2 Jul 2000 00:44:05 +0000 Subject: [PATCH] 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 --- lib/dbi.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dbi.py b/lib/dbi.py index ae18b400..cef8325b 100644 --- a/lib/dbi.py +++ b/lib/dbi.py @@ -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)