Skip to content

Commit

Permalink
Use pkgutil instead of pkg_resources.
Browse files Browse the repository at this point in the history
pkgutil is part of the standard library. So, by using pkgutil.get_data, we can avoid a runtime dependency on setuptools.
  • Loading branch information
benjaminp committed Feb 22, 2018
1 parent 02cfc50 commit 542822e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/text_unidecode/__init__.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
import os
from pkg_resources import resource_filename

_data_path = resource_filename(__name__, 'data.bin')
with open(_data_path, 'rb') as f:
_replaces = f.read().decode('utf8').split('\x00')
import pkgutil

_replaces = pkgutil.get_data(__name__, 'data.bin').decode('utf8').split('\x00')

def unidecode(txt):
chars = []
Expand Down

0 comments on commit 542822e

Please sign in to comment.