Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions python/MDSplus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def _mimport(name, level=1):
if not __package__:
return __import__(name, globals())
return __import__(name, globals(), level=level)
except:
except Exception:
return __import__(name, globals())


Expand All @@ -67,11 +67,11 @@ class libs:
TdiShr = _ver.load_library('TdiShr')
try:
Mdsdcl = _ver.load_library('Mdsdcl')
except:
except Exception:
Mdsdcl = None
try:
MdsIpShr = _ver.load_library('MdsIpShr')
except:
except Exception:
MdsIpShr = None


Expand All @@ -89,7 +89,7 @@ class libs:
Version: %s
Release Date: %s
""" % (__doc__, __version__, _version.release_date)
except:
except Exception:
if version_check and 'PYTHONPATH' in os.environ:
sys.stderr.write(
"PYTHONPATH was set to: %s and unable to import version information\n" % os.environ['PYTHONPATH'])
Expand All @@ -100,7 +100,7 @@ def version_check():
try:
libs.MdsShr.MdsRelease.restype = ctypes.c_char_p
verchk = _ver.tostr(libs.MdsShr.MdsRelease())
except:
except Exception:
verchk = "unknown"
if verchk != __version__ or verchk == "unknown":
sys.stderr.write('''Warning:
Expand All @@ -113,7 +113,7 @@ def version_check():
del version_check


def load_package(gbls={}, version_check=False):
def load_package(gbls, version_check=False):
def loadmod_full(name, gbls):
mod = _mimport(name)
for key in mod.__dict__:
Expand Down Expand Up @@ -146,7 +146,7 @@ def PyLib():
else 'python%d.%d') % sys.version_info[0:2]
try:
lib = ctypes.util.find_library(name)
except:
except Exception:
lib = None
if lib is None:
lib = os.getenv("PyLib", None)
Expand All @@ -159,7 +159,7 @@ def PyLib():
load_package(globals(), True)
try:
_mimport("magic") # load ipython magic
except:
except Exception:
pass
del load_package
del _ver
2 changes: 1 addition & 1 deletion python/MDSplus/_mdsshr.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
def _mimport(name, level=1):
try:
return __import__(name, globals(), level=level)
except:
except Exception:
return __import__(name, globals())


Expand Down
4 changes: 2 additions & 2 deletions python/MDSplus/apd.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
def _mimport(name, level=1):
try:
return __import__(name, globals(), level=level)
except:
except Exception:
return __import__(name, globals())


Expand All @@ -52,7 +52,7 @@ class Apd(_dat.TreeRefX, _arr.Array):
@property
def _descriptor(self):
descs = self.descs
d = _dsc.Descriptor_apd()
d = _dsc.DescriptorAPD()
d.scale = 0
d.digits = 0
d.aflags = 0
Expand Down
Loading