Skip to content

Commit

Permalink
Use pkg_resources to keep the package zip-safe
Browse files Browse the repository at this point in the history
  • Loading branch information
superseed committed Oct 17, 2017
1 parent e5655a9 commit ffbdc04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
include README.rst
include _dump.pl
include src/text_unicode/data.bin
include test_unidecode.py
include test_unidecode.py
3 changes: 2 additions & 1 deletion src/text_unidecode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from pkg_resources import resource_filename

_data_path = os.path.join(os.path.dirname(__file__), 'data.bin')
_data_path = resource_filename(__name__, 'data.bin')
with open(_data_path, 'rb') as f:
_replaces = f.read().decode('utf8').split('\x00')

Expand Down

0 comments on commit ffbdc04

Please sign in to comment.