Skip to content

Commit

Permalink
🐛 Do not add $datarootdir/ocropus to model search path in windows
Browse files Browse the repository at this point in the history
fix #267
  • Loading branch information
kba committed Nov 30, 2017
1 parent 5027794 commit 113c38a
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 113c38a

Please sign in to comment.