1
    m = ldap.initialize(server)
    try:
        m.start_tls_s()
    except ldap.LDAPError, e:
        print e

This part of a python script. I am getting the error in the line "except ldap.LDAPError, e:". But it seems to be right. Can anyone help?

Thanks!

3
  • 2
    And what version of Python are you using? Commented Aug 1, 2011 at 16:40
  • i am using Python 3. It says "Invalid Syntax" Commented Aug 1, 2011 at 16:52
  • @Andy please edit your question and include critical information like python version, os, significant portion of the code or more details about it's behaviour, as well as the error you're getting. Commented Aug 1, 2011 at 16:57

1 Answer 1

3

If you use Python 3 that's

m = ldap.initialize(server)
try:
    m.start_tls_s()
except ldap.LDAPError as e:
    print(e)

See the language reference.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.