From f1c7ca93c1f8b72644fd52878e2fd5cbf0a45ea7 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 14 Jan 2011 13:08:27 +0000 Subject: cgi: use isinstance(x, list) instead of type(x) == type([]) --- Lib/cgi.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/cgi.py b/Lib/cgi.py index d17ed96..e198ed8 100755 --- a/Lib/cgi.py +++ b/Lib/cgi.py @@ -582,7 +582,7 @@ class FieldStorage: """Dictionary style get() method, including 'value' lookup.""" if key in self: value = self[key] - if type(value) is type([]): + if isinstance(value, list): return [x.value for x in value] else: return value.value @@ -593,7 +593,7 @@ class FieldStorage: """ Return the first value received.""" if key in self: value = self[key] - if type(value) is type([]): + if isinstance(value, list): return value[0].value else: return value.value @@ -604,7 +604,7 @@ class FieldStorage: """ Return list of received values.""" if key in self: value = self[key] - if type(value) is type([]): + if isinstance(value, list): return [x.value for x in value] else: return [value.value] -- cgit v0.12