Skip to content

Commit

Permalink
Fix #751
Browse files Browse the repository at this point in the history
Python 2 SyntaxError in models.py
  • Loading branch information
burnash committed Apr 6, 2020
1 parent 9bddcd9 commit a52db70
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gspread/models.py
Expand Up @@ -1273,7 +1273,9 @@ def resize(self, rows=None, cols=None):

return self.spreadsheet.batch_update(body)

def sort(self, *specs, range=None):
# TODO(post Python 2): replace the method signature with
# def sort(self, *specs, range=None):
def sort(self, *specs, **kwargs):
"""Sorts worksheet using given sort orders.
:param specs: The sort order per column. Each sort order represented
Expand All @@ -1295,8 +1297,10 @@ def sort(self, *specs, range=None):
.. versionadded:: 3.4
"""
if range:
start_a1, end_a1 = range.split(':')
range_name = kwargs.pop('range', None)

if range_name:
start_a1, end_a1 = range_name.split(':')
start_row, start_col = a1_to_rowcol(start_a1)
end_row, end_col = a1_to_rowcol(end_a1)
else:
Expand Down

0 comments on commit a52db70

Please sign in to comment.