ccode = compile(cmd, "PDM Input", "eval")
except SyntaxError:
ccode = compile(cmd, "PDM Input", "exec")
- exec ccode in self.mod.__dict__
+ exec(ccode, self.mod.__dict__)
self.cl.send("+OK\n")
else:
self.echo(eval(ccode, self.mod.__dict__))
self.subscribed = {}
def closed(self):
- for id, recv in self.subscribed.iteritems():
+ for id, recv in self.subscribed.items():
ob = self.odtab[id]
if ob is None: continue
ob, protos = ob
raise ValueError("Object does not support PDM introspection")
try:
proto = ob.pdm_protocols()
- except Exception, exc:
+ except Exception as exc:
raise ValueError("PDM introspection failed", exc)
self.odtab[id] = ob, proto
return proto
return
try:
proto = self.bindob(id, ob)
- except Exception, exc:
+ except Exception as exc:
self.send("-", exc)
return
self.send("+", proto)
return
try:
ob = src.lookup(obnm)
- except KeyError, exc:
+ except KeyError as exc:
self.send("-", exc)
return
try:
proto = self.bindob(tgtid, ob)
- except Exception, exc:
+ except Exception as exc:
self.send("-", exc)
return
self.send("+", proto)
return
try:
ret = ob.readattr()
- except Exception, exc:
+ except Exception as exc:
self.send("-", Exception("Could not read attribute"))
return
self.send("+", ret)
return
try:
self.send("+", ob.invoke(method, *args, **kwargs))
- except Exception, exc:
+ except Exception as exc:
self.send("-", exc)
def event(self, id, ob, ev):
cl.start()
class unixlistener(listener):
- def __init__(self, name, mode = 0600, group = None):
+ def __init__(self, name, mode = 0o600, group = None):
super(unixlistener, self).__init__()
self.name = name
self.mode = mode
last = spec
if "/" in first:
parts = spec.split(":")
- mode = 0600
+ mode = 0o600
group = None
if len(parts) > 1:
mode = int(parts[1], 0)