summaryrefslogtreecommitdiffstats
path: root/Demo/imputil/knee.py
diff options
context:
space:
mode:
Diffstat (limited to 'Demo/imputil/knee.py')
-rw-r--r--Demo/imputil/knee.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Demo/imputil/knee.py b/Demo/imputil/knee.py
index 26119e8..49fdf2b 100644
--- a/Demo/imputil/knee.py
+++ b/Demo/imputil/knee.py
@@ -22,10 +22,10 @@ def import_hook(name, globals=None, locals=None, fromlist=None):
return m
def determine_parent(globals):
- if not globals or not globals.has_key("__name__"):
+ if not globals or "__name__" not in globals:
return None
pname = globals['__name__']
- if globals.has_key("__path__"):
+ if "__path__" in globals:
parent = sys.modules[pname]
assert globals is parent.__dict__
return parent
@@ -56,7 +56,7 @@ def find_head_package(parent, name):
parent = None
q = import_module(head, qname, parent)
if q: return q, tail
- raise ImportError, "No module named " + qname
+ raise ImportError("No module named " + qname)
def load_tail(q, tail):
m = q
@@ -67,7 +67,7 @@ def load_tail(q, tail):
mname = "%s.%s" % (m.__name__, head)
m = import_module(head, mname, m)
if not m:
- raise ImportError, "No module named " + mname
+ raise ImportError("No module named " + mname)
return m
def ensure_fromlist(m, fromlist, recursive=0):
@@ -85,7 +85,7 @@ def ensure_fromlist(m, fromlist, recursive=0):
subname = "%s.%s" % (m.__name__, sub)
submod = import_module(sub, subname, m)
if not submod:
- raise ImportError, "No module named " + subname
+ raise ImportError("No module named " + subname)
def import_module(partname, fqname, parent):
try: