Skip to content

Commit

Permalink
Merge pull request #268 from tmbdev/windows-sysconfig
Browse files Browse the repository at this point in the history
🐛 Do not add $datarootdir/ocropus to model if it is None
  • Loading branch information
zuphilip authored Dec 8, 2017
2 parents 61562ce + 113c38a commit d6a6570
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions ocrolib/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit d6a6570

Please sign in to comment.