Traceback (most recent call last):
File "OpenLdapServer.py", line 6, in <module>
from ldaptor.inmemory import fromLDIFFile
File "C:\Users\RnD_01\AppData\Local\Programs\Python\Python36-32\lib\site-packages\ldaptor-16.0.0-py3.6.egg\ldaptor\inmemory.py", line 59
raise ldaperrors.LDAPEntryAlreadyExists, self._children[rdn_str].dn
^
SyntaxError: invalid syntax
我不知道为什么会出现语法错误。
问题是ldaptor
不支持python3,它是用python2写的,你试图在python 3环境中运行代码,python 2和3中raise异常的语法是不同的:
蟒蛇2:
raise IOError, "file error"
或者
raise IOError("file error")
蟒蛇3:
raise IOError("file error")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句