|
79 | 79 | from oauth2client.util import _add_query_parameter |
80 | 80 | from oauth2client.util import positional |
81 | 81 |
|
| 82 | +import sys |
| 83 | +if sys.version > '3': |
| 84 | + long = int |
82 | 85 |
|
83 | 86 | # The client library requires a version of httplib2 that supports RETRIES. |
84 | 87 | httplib2.RETRIES = 1 |
@@ -339,7 +342,7 @@ def _media_size_to_long(maxSize): |
339 | 342 | The size as an integer value. |
340 | 343 | """ |
341 | 344 | if len(maxSize) < 2: |
342 | | - return 0L |
| 345 | + return long(0) |
343 | 346 | units = maxSize[-2:].upper() |
344 | 347 | bit_shift = _MEDIA_SIZE_BIT_SHIFTS.get(units) |
345 | 348 | if bit_shift is not None: |
@@ -436,7 +439,7 @@ def _fix_up_media_upload(method_desc, root_desc, path_url, parameters): |
436 | 439 | accepted for media upload. Defaults to empty list if not in the |
437 | 440 | discovery document. |
438 | 441 | - max_size is a long representing the max size in bytes allowed for a |
439 | | - media upload. Defaults to 0L if not in the discovery document. |
| 442 | + media upload. Defaults to long(0) if not in the discovery document. |
440 | 443 | - media_path_url is a String; the absolute URI for media upload for the |
441 | 444 | API method. Constructed using the API root URI and service path from |
442 | 445 | the discovery document and the relative path for the API method. If |
@@ -481,7 +484,7 @@ def _fix_up_method_description(method_desc, root_desc): |
481 | 484 | accepted for media upload. Defaults to empty list if not in the |
482 | 485 | discovery document. |
483 | 486 | - max_size is a long representing the max size in bytes allowed for a |
484 | | - media upload. Defaults to 0L if not in the discovery document. |
| 487 | + media upload. Defaults to long(0) if not in the discovery document. |
485 | 488 | - media_path_url is a String; the absolute URI for media upload for the |
486 | 489 | API method. Constructed using the API root URI and service path from |
487 | 490 | the discovery document and the relative path for the API method. If |
|
0 commit comments