Py3 dsdb lock

github at samba.org github at samba.org
Tue Apr 10 18:53:32 UTC 2018


New comment by abbra on Samba Github repository

https://github.com/samba-team/samba/pull/161#issuecomment-380209368
Comment:
six is essential but 'future' can be omitted. In this case you can replace future.iteritems by a native key iteration which will work in both py2 and py3:
```diff
-        for key, val in global_settings.iteritems():
+        for key in global_settings:
             f.write("\t%s = %s\n" % (key, global_settings[key]))
         f.write("\n")
```
I'd also recommend following a Conservative Porting Guide that was developed when porting many Python applications, including majority of Samba code: http://portingguide.readthedocs.io/en/latest/index.html


More information about the samba-technical mailing list