Skip to content

Commit

Permalink
Replace future with six
Browse files Browse the repository at this point in the history
 * This closes facetoe#402
  • Loading branch information
gGonz committed Feb 17, 2020
1 parent b15073b commit fc414cd
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions requirements.dev
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cachetools>=3.1.0
requests>=2.14.2
pytz>=2018.9
future>=0.17.1
python-dateutil>=2.7.5
sphinx>=1.8.4
pycodestyle>=2.5.0
Expand All @@ -12,4 +11,5 @@ nose>=1.3.7
yapf>=0.26.0
bs4>=0.0.1
lxml>=4.3.1
sphinx_rtd_theme>=0.4.3
sphinx_rtd_theme>=0.4.3
six>=1.14.0
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cachetools>=3.1.0
requests>=2.14.2
pytz>=2018.9
future>=0.17.1
python-dateutil>=2.7.5
six>=1.14.0
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
'python-dateutil>=2.7.5',
'cachetools>=3.1.0',
'pytz>=2018.9',
'future>=0.17.1'
'six>=1.14.0',
],
keywords=['zendesk', 'api', 'wrapper'],
classifiers=[
Expand Down
8 changes: 5 additions & 3 deletions zenpy/lib/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
from abc import abstractmethod
from datetime import datetime, timedelta

from future.standard_library import install_aliases

from zenpy.lib.util import as_plural
from zenpy.lib.exception import SearchResponseLimitExceeded

Expand All @@ -15,7 +13,7 @@
except ImportError:
from collections import Iterable

install_aliases()
import six
from math import ceil

__author__ = 'facetoe'
Expand Down Expand Up @@ -125,6 +123,10 @@ def _retrieve_slice(self, start, stop, page_size):
min_page = ceil(start / page_size)
max_page = ceil(stop / page_size) + 1

if six.PY2:
min_page = int(min_page)
max_page = int(max_page)

# Calculate the lower and upper bounds for the final slice.
padding = ((max_page - min_page) - 1) * page_size
lower = start % page_size or page_size
Expand Down
2 changes: 1 addition & 1 deletion zenpy/lib/response.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from zenpy.lib.generator import SearchResultGenerator, ZendeskResultGenerator, ChatResultGenerator, ViewResultGenerator, \
TicketAuditGenerator, ChatIncrementalResultGenerator, JiraLinkGenerator
from zenpy.lib.util import as_singular, as_plural, get_endpoint_path
from urllib.parse import urlparse
from six.moves.urllib.parse import urlparse


class ResponseHandler(object):
Expand Down

0 comments on commit fc414cd

Please sign in to comment.