Use "foo is None" instead of "foo == None".
[mirror/userdir-ldap.git] / ud-emailmatcher
index bae8fd9..aa717d5 100755 (executable)
@@ -52,8 +52,7 @@ for x in arguments:
 Args = Args + GPGSearchOptions + [" 2> /dev/null"]
 Keys = os.popen(" ".join(Args),"r")
 
-l = ldap.open(LDAPServer);
-l.simple_bind_s("","");
+l = connectLDAP()
 
 # Fetch the key list and map to email address
 PasswdAttrs = l.search_s(BaseDn,ldap.SCOPE_ONELEVEL,"keyfingerprint=*",\
@@ -85,7 +84,7 @@ while(1):
       if FingerPrint != None and UID != None:
          for x in Emails:
             Match = AddressSplit.match(x);
-            if Match == None:
+            if Match is None:
               continue;
             Groups = Match.groups();
            Email = Groups[1]+'@'+Groups[2];