Skip to content

Commit

Permalink
py3: Use "int" instead of "long" (in Python code)
Browse files Browse the repository at this point in the history
In Python 2.7, long integers behave sufficiently similarly
to normal int.
In Python 3, there is only one kind of int.
  • Loading branch information
pyldap contributors authored and Petr Viktorin committed Nov 24, 2017
1 parent 587460a commit 03e8e7e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Lib/ldap/ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ def __init__(
self._retry_max = retry_max
self._retry_delay = retry_delay
self._start_tls = 0
self._reconnects_done = 0L
self._reconnects_done = 0

def __getstate__(self):
"""return data representation for pickled object"""
Expand Down Expand Up @@ -886,7 +886,7 @@ def reconnect(self,uri,retry_max=1,retry_delay=60.0):
self._trace_file.write('*** %s reconnect to %s successful => repeat last operation\n' % (
counter_text,uri
))
self._reconnects_done = self._reconnects_done + 1L
self._reconnects_done = self._reconnects_done + 1
break
finally:
self._reconnect_lock.release()
Expand Down
4 changes: 2 additions & 2 deletions Lib/ldap/schema/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ def _set_attrs(self,l,d):
self.syntax_len = None
for i in l:
if i.startswith("{") and i.endswith("}"):
self.syntax_len=long(i[1:-1])
self.syntax_len = int(i[1:-1])
else:
self.syntax_len = long(syntax_len[:-1])
self.syntax_len = int(syntax_len[:-1])
self.single_value = d['SINGLE-VALUE']!=None
self.collective = d['COLLECTIVE']!=None
self.no_user_mod = d['NO-USER-MODIFICATION']!=None
Expand Down

0 comments on commit 03e8e7e

Please sign in to comment.