summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelie <elie>2010-12-12 21:11:41 +0000
committerelie <elie>2010-12-12 21:11:41 +0000
commitba4a9c48dc52666aa31bfd9ee8b02badbb4e543d (patch)
treeb9d15de9bfd70f9c8a9d3150d7e723f165e23fea
parent97d35c7dd318fd266563d92c40eed4a292993366 (diff)
downloadpysnmp-ba4a9c48dc52666aa31bfd9ee8b02badbb4e543d.tar.gz
'self' shadowing in lambda fixes
-rw-r--r--pysnmp/entity/rfc3413/cmdgen.py4
-rw-r--r--pysnmp/proto/api/v1.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/pysnmp/entity/rfc3413/cmdgen.py b/pysnmp/entity/rfc3413/cmdgen.py
index ea7f21d..1766e6b 100644
--- a/pysnmp/entity/rfc3413/cmdgen.py
+++ b/pysnmp/entity/rfc3413/cmdgen.py
@@ -452,7 +452,7 @@ class NextCommandGenerator(CommandGeneratorBase):
pMod.apiPDU.setRequestID(PDU, pMod.getNextRequestID())
pMod.apiPDU.setVarBinds(
- PDU, map(lambda (x,y): (x,self._null), varBindTable[-1])
+ PDU, map(lambda (x,y),self=self: (x,self._null), varBindTable[-1])
)
self._sendPdu(
@@ -581,7 +581,7 @@ class BulkCommandGenerator(CommandGeneratorBase):
return # no more objects available
pMod.apiBulkPDU.setVarBinds(
- PDU, map(lambda (x,y): (x,self._null), varBindTable[-1])
+ PDU, map(lambda (x,y),self=self: (x,self._null), varBindTable[-1])
)
self._sendPdu(
diff --git a/pysnmp/proto/api/v1.py b/pysnmp/proto/api/v1.py
index dac8971..2096f33 100644
--- a/pysnmp/proto/api/v1.py
+++ b/pysnmp/proto/api/v1.py
@@ -102,7 +102,7 @@ class PDUAPI:
def getVarBindTable(self, reqPDU, rspPDU):
if apiPDU.getErrorStatus(rspPDU) == 2:
return [
- map(lambda (x,y): (x, self._null), apiPDU.getVarBinds(reqPDU))
+ map(lambda (x,y),self=self: (x, self._null), apiPDU.getVarBinds(reqPDU))
]
else:
return [ apiPDU.getVarBinds(rspPDU) ]