summaryrefslogtreecommitdiff
path: root/dev-python/pdfrw/files/pdfrw-fix-import-collections-warning.patch
blob: fe5971264d86a61ade0e4bdb62ee5a03c6febb34 (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
diff --git a/pdfrw/pdfreader.py b/pdfrw/pdfreader.py
index 2c9c3a2..feb025b 100644
--- a/pdfrw/pdfreader.py
+++ b/pdfrw/pdfreader.py
@@ -12,9 +12,10 @@ of the object.
 '''
 import gc
 import binascii
-import collections
 import itertools
 
+from collections import defaultdict
+
 from .errors import PdfParseError, log
 from .tokens import PdfTokens
 from .objects import PdfDict, PdfArray, PdfName, PdfObject, PdfIndirect
@@ -340,7 +341,7 @@ class PdfReader(PdfDict):
 
     def parse_xref_stream(self, source, int=int, range=range,
                           enumerate=enumerate, islice=itertools.islice,
-                          defaultdict=collections.defaultdict,
+                          defaultdict=defaultdict,
                           hexlify=binascii.hexlify):
         ''' Parse (one of) the cross-reference file section(s)
         '''
diff --git a/tests/expected.py b/tests/expected.py
index d153fc3..62c29aa 100644
--- a/tests/expected.py
+++ b/tests/expected.py
@@ -12,8 +12,8 @@
 '''
 
 import os
-import collections
 from pdfrw.py23_diffs import convert_load
+from collections import defaultdict
 
 root_dir = os.path.dirname(__file__)
 result_dir = 'tmp_results'
@@ -28,7 +28,7 @@ for sourcef in ('mytests.txt', 'expected.txt'):
 
 
 def results():
-    results = collections.defaultdict(set)
+    results = defaultdict(set)
     with open(expectedf, 'rb') as f:
         for line in f:
             line = convert_load(line)