get_postscript_icc_path: don't check the same path multiple times

This commit is contained in:
James R. Barlow
2016-02-29 12:45:58 -08:00
parent c8901666c4
commit 0360f078de
+4 -1
View File
@@ -8,6 +8,7 @@ from string import Template
from subprocess import Popen, PIPE
import os
import codecs
from collections import OrderedDict
from . import get_program
@@ -114,7 +115,9 @@ def _get_postscript_icc_path():
yield from (
path.strip() for path in line.split(':')
if path.strip() != '')
for root in search_paths(lines):
ordered_paths_once = OrderedDict.fromkeys(search_paths(lines))
for root in ordered_paths_once.keys():
path = os.path.realpath(os.path.join(root, '../iccprofiles'))
if os.path.exists(path):
return path