Permalink
Browse files

Misc forward-compatibility fixes

  • Loading branch information...
1 parent e97fbbf commit 399a41d129405e022b0d2783c3e9caf656e92e92 @gholms gholms committed with garnaat Mar 11, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 boto/ec2/keypair.py
  2. +2 −2 boto/mturk/connection.py
  3. +1 −1 boto/sts/credentials.py
  4. +1 −1 tests/mturk/_init_environment.py
View
@@ -83,7 +83,7 @@ def save(self, directory_path):
fp = open(file_path, 'wb')
fp.write(self.material)
fp.close()
- os.chmod(file_path, 0600)
+ os.chmod(file_path, 0o600)
return True
else:
raise BotoClientError('KeyPair contains no material')
View
@@ -265,7 +265,7 @@ def _get_pages(page_size, total_records):
records, return the page numbers to be retrieved.
"""
pages = total_records/page_size+bool(total_records%page_size)
- return range(1, pages+1)
+ return list(range(1, pages+1))
def get_all_hits(self):
@@ -280,7 +280,7 @@ def get_all_hits(self):
page_size = 100
search_rs = self.search_hits(page_size=page_size)
total_records = int(search_rs.TotalNumResults)
- get_page_hits = lambda(page): self.search_hits(page_size=page_size, page_number=page)
+ get_page_hits = lambda page: self.search_hits(page_size=page_size, page_number=page)
page_nums = self._get_pages(page_size, total_records)
hit_sets = itertools.imap(get_page_hits, page_nums)
return itertools.chain.from_iterable(hit_sets)
View
@@ -116,7 +116,7 @@ def save(self, file_path):
fp = open(file_path, 'wb')
json.dump(self.to_dict(), fp)
fp.close()
- os.chmod(file_path, 0600)
+ os.chmod(file_path, 0o600)
def is_expired(self, time_offset_seconds=0):
"""
@@ -7,7 +7,7 @@
try:
local = os.path.join(os.path.dirname(__file__), 'local.py')
- execfile(local)
+ exec(compile(open(local).read(), local, 'exec'))
except:
pass

0 comments on commit 399a41d

Please sign in to comment.