From 0911703eba93b18c3063ce47e4afa65cd2885ec3 Mon Sep 17 00:00:00 2001 From: Quentin Pradet Date: Tue, 6 Mar 2018 14:53:11 +0400 Subject: [PATCH] pdfcolor: Fix Python 2.6 compatibility --- pdfminer/pdfcolor.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pdfminer/pdfcolor.py b/pdfminer/pdfcolor.py index e067f4b..ba09ba2 100644 --- a/pdfminer/pdfcolor.py +++ b/pdfminer/pdfcolor.py @@ -21,7 +21,11 @@ class PDFColorSpace(object): return '' % (self.name, self.ncomponents) -PREDEFINED_COLORSPACE = collections.OrderedDict() +if six.PY2: + PREDEFINED_COLORSPACE = {} +else: + PREDEFINED_COLORSPACE = collections.OrderedDict() + for (name, n) in [ ('DeviceGray', 1), # default value first ('CalRGB', 3),