[Yt-svn] yt: Put sqlite3 import inside a try block such that imports from

hg at spacepope.org hg at spacepope.org
Fri Sep 3 10:57:09 PDT 2010


hg Repository: yt
details:   yt/rev/7cb218c4c65e
changeset: 3374:7cb218c4c65e
user:      Britton Smith <brittonsmith at gmail.com>
date:
Fri Sep 03 13:57:01 2010 -0400
description:
Put sqlite3 import inside a try block such that imports from
yt.analysis_modules.api don't fail.

diffstat:

 yt/analysis_modules/halo_merger_tree/merger_tree.py |  7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diffs (24 lines):

diff -r d134c2c665ec -r 7cb218c4c65e yt/analysis_modules/halo_merger_tree/merger_tree.py
--- a/yt/analysis_modules/halo_merger_tree/merger_tree.py	Thu Sep 02 19:41:12 2010 -0700
+++ b/yt/analysis_modules/halo_merger_tree/merger_tree.py	Fri Sep 03 13:57:01 2010 -0400
@@ -27,7 +27,11 @@
 import os, glob, md5, time, gc, sys
 import h5py
 import types
-import sqlite3 as sql
+try:
+    import sqlite3 as sql
+except ImportError:
+    mylog.error("sqlite3 not imported!")
+
 from yt.funcs import *
 
 from yt.analysis_modules.halo_finding.halo_objects import \
@@ -35,6 +39,7 @@
 from yt.analysis_modules.halo_profiler.multi_halo_profiler import \
     HaloProfiler
 from yt.convenience import load
+from yt.utilities.logger import ytLogger as mylog
 try:
     from yt.utilities.kdtree import *
 except ImportError:



More information about the yt-svn mailing list