Permalink
Browse files

Compare against literal types, not types module classes

  • Loading branch information...
1 parent 39dd094 commit e97fbbf17b951e4cacf715a9e01364bd7eb70b9f @gholms gholms committed with garnaat Mar 11, 2012
Showing with 9 additions and 10 deletions.
  1. +7 −8 boto/emr/connection.py
  2. +1 −1 boto/sdb/db/manager/sdbmanager.py
  3. +1 −1 boto/sdb/db/manager/xmlmanager.py
View
@@ -23,7 +23,6 @@
"""
Represents a connection to the EMR service
"""
-import types
import boto
import boto.utils
@@ -135,7 +134,7 @@ def add_jobflow_steps(self, jobflow_id, steps):
:type steps: list(boto.emr.Step)
:param steps: A list of steps to add to the job
"""
- if type(steps) != types.ListType:
+ if type(steps) != list:
steps = [steps]
params = {}
params['JobFlowId'] = jobflow_id
@@ -158,7 +157,7 @@ def add_instance_groups(self, jobflow_id, instance_groups):
:type instance_groups: list(boto.emr.InstanceGroup)
:param instance_groups: A list of instance groups to add to the job
"""
- if type(instance_groups) != types.ListType:
+ if type(instance_groups) != list:
instance_groups = [instance_groups]
params = {}
params['JobFlowId'] = jobflow_id
@@ -179,9 +178,9 @@ def modify_instance_groups(self, instance_group_ids, new_sizes):
:type new_sizes: list(int)
:param new_sizes: A list of the new sizes for each instance group
"""
- if type(instance_group_ids) != types.ListType:
+ if type(instance_group_ids) != list:
instance_group_ids = [instance_group_ids]
- if type(new_sizes) != types.ListType:
+ if type(new_sizes) != list:
new_sizes = [new_sizes]
instance_groups = zip(instance_group_ids, new_sizes)
@@ -399,7 +398,7 @@ def _build_step_args(self, step):
return step_params
def _build_bootstrap_action_list(self, bootstrap_actions):
- if type(bootstrap_actions) != types.ListType:
+ if type(bootstrap_actions) != list:
bootstrap_actions = [bootstrap_actions]
params = {}
@@ -409,7 +408,7 @@ def _build_bootstrap_action_list(self, bootstrap_actions):
return params
def _build_step_list(self, steps):
- if type(steps) != types.ListType:
+ if type(steps) != list:
steps = [steps]
params = {}
@@ -475,7 +474,7 @@ def _build_instance_group_list_args(self, instance_groups):
a comparable dict for use in making a RunJobFlow or AddInstanceGroups
request.
"""
- if type(instance_groups) != types.ListType:
+ if type(instance_groups) != list:
instance_groups = [instance_groups]
params = {}
@@ -589,7 +589,7 @@ def _build_filter_part(self, cls, filters, order_by=None, select=None):
property = cls.find_property(name)
if name == order_by:
order_by_filtered = True
- if types.TypeType(value) == types.ListType:
+ if types.TypeType(value) == list:
filter_parts_sub = []
for val in value:
val = self.encode_value(property, val)
@@ -373,7 +373,7 @@ def _build_query(self, cls, filters, limit, order_by):
for property in properties:
if property.name == name:
found = True
- if types.TypeType(value) == types.ListType:
+ if types.TypeType(value) == list:
filter_parts = []
for val in value:
val = self.encode_value(property, val)

0 comments on commit e97fbbf

Please sign in to comment.