You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.4 KiB
49 lines
1.4 KiB
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)
|