Update of /cvsroot/monetdb/clients/src/python/Cimpl
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv22310
Modified Files:
Tag: Clients_1-20
CMapi.py
Log Message:
I don't know what the original intention was, but this code couldn't
work (in fact, there was an error).
- Bare except is a bad idea: be specific in what errors you want to
catch.
- In the except clause two variables were used that were never
assigned to.
- Removed the except completely since an error might as well be passed
to the caller.
By the way, using _Mapi__mid is an extreme hack. __mid is meant to be
a private (i.e. untouchable) attribute in the Mapi class. This should
be solved differently.
Index: CMapi.py
===================================================================
RCS file: /cvsroot/monetdb/clients/src/python/Cimpl/CMapi.py,v
retrieving revision 1.4.2.3
retrieving revision 1.4.2.4
diff -u -d -r1.4.2.3 -r1.4.2.4
--- CMapi.py 22 Oct 2007 12:13:35 -0000 1.4.2.3
+++ CMapi.py 25 Oct 2007 08:02:04 -0000 1.4.2.4
@@ -242,16 +242,12 @@
class Embedded(Mapi):
def __init__(self, dbfarm = None, dbname = "demo", lang = "sql", version =
5):
- try:
- if version == 5:
- import monetdb5 as monetdb
- else:
- import monetdb
- if lang == "sql":
- self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname)
- except:
- e, value
- print(e)
+ if version == 5:
+ import monetdb5 as monetdb
+ else:
+ import monetdb
+ if lang == "sql":
+ self._Mapi__mid = monetdb.monetdb_sql(dbfarm, dbname)
if not self._Mapi__mid:
raise IOError("Creating connection structure failed")
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins