Skip to content

Commit b2c0d10

Browse files
committed
drop support for python 2.7
1 parent 687fbb5 commit b2c0d10

File tree

6 files changed

+7
-19
lines changed

6 files changed

+7
-19
lines changed

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ language: python
22
sudo: required
33
dist: xenial
44
python:
5-
- "2.7"
65
- "3.5"
76
- "3.6"
87
- "3.7"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ First, install Flask-SimpleLDAP:
1414

1515
Flask-SimpleLDAP depends, and will install for you, recent versions of Flask
1616
(0.12.4 or later) and [pyldap](https://github.com/pyldap/pyldap). Flask-SimpleLDAP is compatible
17-
with and tested on Python 2.7, 3.5, 3.6 and 3.7.
17+
with and tested on Python 3.5, 3.6 and 3.7.
1818

1919
Next, add a ``LDAP`` instance to your code and at least the three
2020
required configuration options:

docs/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def __getattr__(cls, name):
6464
# built documents.
6565
#
6666
# The short X.Y version.
67-
version = '1.3.2'
67+
version = '1.4.0'
6868
# The full version, including alpha/beta/rc tags.
69-
release = '1.3.2'
69+
release = '1.4.0'
7070

7171
# The language for content autogenerated by Sphinx. Refer to documentation
7272
# for a list of supported languages.

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ First, install Flask-SimpleLDAP:
2020
2121
Flask-SimpleLDAP depends, and will install for you, recent versions of Flask
2222
(0.12.4 or later) and pyldap. Flask-SimpleLDAP is compatible
23-
with and tested on Python 2.7, 3.5, 3.6 and 3.7.
23+
with and tested on Python 3.5, 3.6 and 3.7.
2424

2525
Next, add a :class:`~flask_simpleldap.LDAP` to your code and at least the three
2626
required configuration options:

flask_simpleldap/__init__.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
# -*- coding: utf-8 -*-
21
import re
32
from functools import wraps
43
import ldap
5-
import sys
64
from ldap import filter as ldap_filter
75
from flask import abort, current_app, g, make_response, redirect, url_for, \
86
request
@@ -235,12 +233,8 @@ def get_user_groups(self, user):
235233
if current_app.config['LDAP_OPENLDAP']:
236234
group_member_filter = \
237235
current_app.config['LDAP_GROUP_MEMBER_FILTER_FIELD']
238-
if sys.version_info[0] > 2:
239-
groups = [record[1][group_member_filter][0].decode(
240-
'utf-8') for record in records]
241-
else:
242-
groups = [record[1][group_member_filter][0] for
243-
record in records]
236+
groups = [record[1][group_member_filter][0] for
237+
record in records]
244238
return groups
245239
else:
246240
if current_app.config['LDAP_USER_GROUPS_FIELD'] in \
@@ -249,8 +243,6 @@ def get_user_groups(self, user):
249243
current_app.config['LDAP_USER_GROUPS_FIELD']]
250244
result = [re.findall(b'(?:cn=|CN=)(.*?),', group)[0]
251245
for group in groups]
252-
if sys.version_info[0] > 2:
253-
result = [r.decode('utf-8') for r in result]
254246
return result
255247
except ldap.LDAPError as e:
256248
raise LDAPException(self.error(e.args))
@@ -275,8 +267,6 @@ def get_group_members(self, group):
275267
records[0][1]:
276268
members = records[0][1][
277269
current_app.config['LDAP_GROUP_MEMBERS_FIELD']]
278-
if sys.version_info[0] > 2:
279-
members = [m.decode('utf-8') for m in members]
280270
return members
281271
except ldap.LDAPError as e:
282272
raise LDAPException(self.error(e.args))

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
setup(
1111
name='Flask-SimpleLDAP',
12-
version='1.3.2',
12+
version='1.4.0',
1313
url='https://github.com/admiralobvious/flask-simpleldap',
1414
license='MIT',
1515
author='Alexandre Ferland',
@@ -29,7 +29,6 @@
2929
'Intended Audience :: Developers',
3030
'License :: OSI Approved :: MIT License',
3131
'Operating System :: OS Independent',
32-
'Programming Language :: Python :: 2.7',
3332
'Programming Language :: Python :: 3.5',
3433
'Programming Language :: Python :: 3.6',
3534
'Programming Language :: Python :: 3.7',

0 commit comments

Comments
 (0)