[PATCH 24/24] pynfs: python3 support plan: fix access class var in list comprehension

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Jianhong.Yin" <yin-jianhong@xxxxxxx>

see: https://stackoverflow.com/questions/13905741/accessing-class-variables-from-a-list-comprehension-in-the-class-definition

Signed-off-by: Jianhong Yin <yin-jianhong@xxxxxxx>
---

Status:
'''
all patches works fine on python-2.7
and build success on python-3.6
but because xdrlib issue https://bugs.python.org/issue9544
 pynfs has not been able to run on python-3.6 now
'''

 nfs4.1/config.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/nfs4.1/config.py b/nfs4.1/config.py
index b4a45d7..8779fe1 100644
--- a/nfs4.1/config.py
+++ b/nfs4.1/config.py
@@ -178,8 +178,9 @@ _invalid_ops = [
 class OpsConfigServer(object):
     __metaclass__ = MetaConfig
     value = ['ERROR', 0, 0] # Note must have value == _opline(value)
-    attrs = [ConfigLine(name.lower()[3:], value, "Generic comment", _opline)
-             for name in nfs_opnum4.values()]
+    attrs = (lambda value=value: [ConfigLine(name.lower()[3:], value, "Generic comment", _opline)
+                                  for name in nfs_opnum4.values()])()
+
 
 class Actions(object):
     __metaclass__ = MetaConfig
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux