From 113c38ad2c858a4e667ac15355c4ead55e539b68 Mon Sep 17 00:00:00 2001 From: Konstantin Baierer Date: Thu, 30 Nov 2017 20:13:13 +0100 Subject: [PATCH] :bug: Do not add $datarootdir/ocropus to model search path in windows fix #267 --- ocrolib/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocrolib/common.py b/ocrolib/common.py index 614add07..e1d8e776 100644 --- a/ocrolib/common.py +++ b/ocrolib/common.py @@ -621,8 +621,10 @@ def ocropus_find_file(fname, gz=True): possible_prefixes.append("/usr/local/share/ocropus") - possible_prefixes.append(os.path.join( - sysconfig.get_config_var("datarootdir"), "ocropus")) + # datarootdir is None in windows so don't add it to search list + if sysconfig.get_config_var("datarootdir") is not None: + possible_prefixes.append(os.path.join( + sysconfig.get_config_var("datarootdir"), "ocropus")) # Unique entries with preserved order in possible_prefixes