Skip to content

Commit

Permalink
Remove unnecessary print_function imports
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Jun 27, 2014
1 parent 425681e commit 3f71c51
Show file tree
Hide file tree
Showing 29 changed files with 27 additions and 81 deletions.
2 changes: 1 addition & 1 deletion boto/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"""
Handles basic connections to AWS
"""
from __future__ import print_function, with_statement
from __future__ import with_statement

import base64
from datetime import datetime
Expand Down
2 changes: 0 additions & 2 deletions boto/ec2/buyreservation.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import boto.ec2
from boto.sdb.db.property import StringProperty, IntegerProperty
from boto.manage import propget
Expand Down
2 changes: 0 additions & 2 deletions boto/ec2/reservedinstance.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

from boto.resultset import ResultSet
from boto.ec2.ec2object import EC2Object
from boto.utils import parse_ts
Expand Down
28 changes: 13 additions & 15 deletions boto/gs/resumable_upload_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import errno
import httplib
import os
Expand Down Expand Up @@ -104,15 +102,15 @@ def _load_tracker_uri_from_file(self):
# is attempted on a file), but warn user for other errors.
if e.errno != errno.ENOENT:
# Will restart because self.tracker_uri is None.
print(('Couldn\'t read URI tracker file (%s): %s. Restarting '
print('Couldn\'t read URI tracker file (%s): %s. Restarting '
'upload from scratch.' %
(self.tracker_file_name, e.strerror)))
(self.tracker_file_name, e.strerror))
except InvalidUriError as e:
# Warn user, but proceed (will restart because
# self.tracker_uri is None).
print(('Invalid tracker URI (%s) found in URI tracker file '
print('Invalid tracker URI (%s) found in URI tracker file '
'(%s). Restarting upload from scratch.' %
(uri, self.tracker_file_name)))
(uri, self.tracker_file_name))
finally:
if f:
f.close()
Expand Down Expand Up @@ -532,19 +530,19 @@ def _check_final_md5(self, key, etag):
def handle_resumable_upload_exception(self, e, debug):
if (e.disposition == ResumableTransferDisposition.ABORT_CUR_PROCESS):
if debug >= 1:
print(('Caught non-retryable ResumableUploadException (%s); '
'aborting but retaining tracker file' % e.message))
print('Caught non-retryable ResumableUploadException (%s); '
'aborting but retaining tracker file' % e.message)
raise
elif (e.disposition == ResumableTransferDisposition.ABORT):
if debug >= 1:
print(('Caught non-retryable ResumableUploadException (%s); '
'aborting and removing tracker file' % e.message))
print('Caught non-retryable ResumableUploadException (%s); '
'aborting and removing tracker file' % e.message)
self._remove_tracker_file()
raise
else:
if debug >= 1:
print(('Caught ResumableUploadException (%s) - will retry' %
e.message))
print('Caught ResumableUploadException (%s) - will retry' %
e.message)

def track_progress_less_iterations(self, server_had_bytes_before_attempt,
roll_back_md5=True, debug=0):
Expand All @@ -568,9 +566,9 @@ def track_progress_less_iterations(self, server_had_bytes_before_attempt,
# Use binary exponential backoff to desynchronize client requests.
sleep_time_secs = random.random() * (2**self.progress_less_iterations)
if debug >= 1:
print(('Got retryable failure (%d progress-less in a row).\n'
print('Got retryable failure (%d progress-less in a row).\n'
'Sleeping %3.1f seconds before re-trying' %
(self.progress_less_iterations, sleep_time_secs)))
(self.progress_less_iterations, sleep_time_secs))
time.sleep(sleep_time_secs)

def send_file(self, key, fp, headers, cb=None, num_cb=10, hash_algs=None):
Expand Down Expand Up @@ -669,7 +667,7 @@ def send_file(self, key, fp, headers, cb=None, num_cb=10, hash_algs=None):
return
except self.RETRYABLE_EXCEPTIONS as e:
if debug >= 1:
print(('Caught exception (%s)' % e.__repr__()))
print('Caught exception (%s)' % e.__repr__())
if isinstance(e, IOError) and e.errno == errno.EPIPE:
# Broken pipe error causes httplib to immediately
# close the socket (http://bugs.python.org/issue5542),
Expand Down
2 changes: 0 additions & 2 deletions boto/manage/cmdshell.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

from boto.mashups.interactive import interactive_shell
import boto
import os
Expand Down
2 changes: 0 additions & 2 deletions boto/manage/propget.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function


def get(prop, choices=None):
prompt = prop.verbose_name
Expand Down
2 changes: 0 additions & 2 deletions boto/manage/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

"""
High-level abstraction of an EC2 server
"""
Expand Down
1 change: 0 additions & 1 deletion boto/manage/test_manage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
from boto.manage.server import Server
from boto.manage.volume import Volume
import time
Expand Down
2 changes: 0 additions & 2 deletions boto/mashups/iobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import os

def int_val_fn(v):
Expand Down
2 changes: 0 additions & 2 deletions boto/mashups/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

"""
High-level abstraction of an EC2 order for servers
"""
Expand Down
2 changes: 0 additions & 2 deletions boto/mashups/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

"""
High-level abstraction of an EC2 server
"""
Expand Down
2 changes: 0 additions & 2 deletions boto/mturk/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import xml.sax
import datetime
import itertools
Expand Down
2 changes: 0 additions & 2 deletions boto/mws/exception.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

from boto.exception import BotoServerError
from boto.mws.response import ResponseFactory

Expand Down
2 changes: 0 additions & 2 deletions boto/pyami/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from __future__ import print_function

import os
import re
import warnings
Expand Down
2 changes: 0 additions & 2 deletions boto/pyami/launch_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from __future__ import print_function

import getopt
import sys
import imp
Expand Down
2 changes: 0 additions & 2 deletions boto/roboto/awsqueryrequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import sys
import os
import boto
Expand Down
28 changes: 13 additions & 15 deletions boto/s3/resumable_download_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import errno
import httplib
import os
Expand Down Expand Up @@ -134,17 +132,17 @@ def _load_tracker_file_etag(self):
# read correctly. Since ETags need not be MD5s, we now do a simple
# length sanity check instead.
if len(self.etag_value_for_current_download) < self.MIN_ETAG_LEN:
print(('Couldn\'t read etag in tracker file (%s). Restarting '
'download from scratch.' % self.tracker_file_name))
print('Couldn\'t read etag in tracker file (%s). Restarting '
'download from scratch.' % self.tracker_file_name)
except IOError as e:
# Ignore non-existent file (happens first time a download
# is attempted on an object), but warn user for other errors.
if e.errno != errno.ENOENT:
# Will restart because
# self.etag_value_for_current_download is None.
print(('Couldn\'t read URI tracker file (%s): %s. Restarting '
print('Couldn\'t read URI tracker file (%s): %s. Restarting '
'download from scratch.' %
(self.tracker_file_name, e.strerror)))
(self.tracker_file_name, e.strerror))
finally:
if f:
f.close()
Expand Down Expand Up @@ -290,7 +288,7 @@ def get_file(self, key, fp, headers, cb=None, num_cb=10, torrent=False,
return
except self.RETRYABLE_EXCEPTIONS as e:
if debug >= 1:
print(('Caught exception (%s)' % e.__repr__()))
print('Caught exception (%s)' % e.__repr__())
if isinstance(e, IOError) and e.errno == errno.EPIPE:
# Broken pipe error causes httplib to immediately
# close the socket (http://bugs.python.org/issue5542),
Expand All @@ -306,21 +304,21 @@ def get_file(self, key, fp, headers, cb=None, num_cb=10, torrent=False,
if (e.disposition ==
ResumableTransferDisposition.ABORT_CUR_PROCESS):
if debug >= 1:
print(('Caught non-retryable ResumableDownloadException '
'(%s)' % e.message))
print('Caught non-retryable ResumableDownloadException '
'(%s)' % e.message)
raise
elif (e.disposition ==
ResumableTransferDisposition.ABORT):
if debug >= 1:
print(('Caught non-retryable ResumableDownloadException '
print('Caught non-retryable ResumableDownloadException '
'(%s); aborting and removing tracker file' %
e.message))
e.message)
self._remove_tracker_file()
raise
else:
if debug >= 1:
print(('Caught ResumableDownloadException (%s) - will '
'retry' % e.message))
print('Caught ResumableDownloadException (%s) - will '
'retry' % e.message)

# At this point we had a re-tryable failure; see if made progress.
if get_cur_file_size(fp) > had_file_bytes_before_attempt:
Expand Down Expand Up @@ -348,7 +346,7 @@ def get_file(self, key, fp, headers, cb=None, num_cb=10, torrent=False,

sleep_time_secs = 2**progress_less_iterations
if debug >= 1:
print(('Got retryable failure (%d progress-less in a row).\n'
print('Got retryable failure (%d progress-less in a row).\n'
'Sleeping %d seconds before re-trying' %
(progress_less_iterations, sleep_time_secs)))
(progress_less_iterations, sleep_time_secs))
time.sleep(sleep_time_secs)
2 changes: 0 additions & 2 deletions boto/sdb/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import xml.sax
import threading
import boto
Expand Down
2 changes: 0 additions & 2 deletions boto/services/bs.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

from optparse import OptionParser
from boto.services.servicedef import ServiceDef
from boto.services.submit import Submitter
Expand Down
2 changes: 0 additions & 2 deletions boto/services/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import os
from datetime import datetime, timedelta
from boto.utils import parse_ts
Expand Down
2 changes: 0 additions & 2 deletions boto/services/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@
# WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
from __future__ import print_function

import time
import os

Expand Down
2 changes: 0 additions & 2 deletions boto/sqs/queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@
"""
Represents an SQS Queue
"""
from __future__ import print_function

from boto.compat import urllib
from boto.sqs.message import Message

Expand Down
2 changes: 0 additions & 2 deletions scripts/git-release-notes.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
#!/usr/bin/env python

from __future__ import print_function

import datetime
import re
import subprocess
Expand Down
2 changes: 0 additions & 2 deletions scripts/rebuild_endpoints.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function

import json
from pyquery import PyQuery as pq
import requests
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/s3/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
"""
Some unit tests for the S3Connection
"""
from __future__ import print_function

import unittest
import time
import os
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/s3/test_encryption.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"""
Some unit tests for the S3 Encryption
"""
from __future__ import print_function

import unittest
import time
from boto.s3.connection import S3Connection
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/sqs/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
"""
Some unit tests for the SQSConnection
"""
from __future__ import print_function, with_statement

import time
from threading import Timer
from tests.unit import unittest
Expand Down
1 change: 0 additions & 1 deletion tests/unit/cloudsearch2/test_search.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import print_function
#!/usr/bin env python

from tests.unit import unittest
Expand Down
2 changes: 0 additions & 2 deletions tests/unit/route53/test_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.
#
from __future__ import print_function

import mock
import re
import xml.dom.minidom
Expand Down

0 comments on commit 3f71c51

Please sign in to comment.