summaryrefslogtreecommitdiff
blob: 87ea53c39648880c70f015e7b7c09c4971061c3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
--- a/paste/lint.py
+++ b/paste/lint.py
@@ -111,7 +111,6 @@
 
 import re
 import sys
-from types import DictType, StringType, TupleType, ListType
 import warnings
 
 header_re = re.compile(r'^[a-zA-Z][a-zA-Z0-9\-_]*$')
@@ -282,7 +281,7 @@
             "Iterator garbage collected without being closed")
 
 def check_environ(environ):
-    assert type(environ) is DictType, (
+    assert isinstance(environ,dict), (
         "Environment is not of the right type: %r (environment: %r)"
         % (type(environ), environ))
     
@@ -309,11 +308,11 @@
         if '.' in key:
             # Extension, we don't care about its type
             continue
-        assert type(environ[key]) is StringType, (
+        assert isinstance(environ[key], str), (
             "Environmental variable %s is not a string: %r (value: %r)"
             % (key, type(environ[key]), environ[key]))
         
-    assert type(environ['wsgi.version']) is TupleType, (
+    assert isinstance(environ['wsgi.version'], tuple), (
         "wsgi.version should be a tuple (%r)" % environ['wsgi.version'])
     assert environ['wsgi.url_scheme'] in ('http', 'https'), (
         "wsgi.url_scheme unknown: %r" % environ['wsgi.url_scheme'])
@@ -359,7 +358,7 @@
             % (wsgi_errors, attr))
 
 def check_status(status):
-    assert type(status) is StringType, (
+    assert isinstance(status, str), (
         "Status must be a string (not %r)" % status)
     # Implicitly check that we can turn it into an integer:
     status_code = status.split(None, 1)[0]
@@ -374,12 +373,12 @@
             % status, WSGIWarning)
 
 def check_headers(headers):
-    assert type(headers) is ListType, (
+    assert isinstance(headers,list), (
         "Headers (%r) must be of type list: %r"
         % (headers, type(headers)))
     header_names = {}
     for item in headers:
-        assert type(item) is TupleType, (
+        assert isinstance(item, tuple), (
             "Individual headers (%r) must be of type tuple: %r"
             % (item, type(item)))
         assert len(item) == 2