Skip to content

Commit 9aba4f9

Browse files
authored
Merge pull request #13 from SamuraiT/fix-Ffile-not-founderror
Fix file not found error
2 parents 1e4d09b + cf27e70 commit 9aba4f9

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

MANIFEST

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# file GENERATED by distutils, do NOT edit
2+
MeCab.i
23
MeCab.py
3-
MeCab_wrap.cxx
44
setup.py

setup.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@
33
from distutils.core import setup, Extension
44
import os
55

6-
with open('README.rst') as readme_file:
7-
readme = readme_file.read()
6+
def read_file(filename):
7+
filepath = os.path.join(
8+
os.path.dirname(os.path.dirname(__file__)), filename)
9+
if os.path.exists(filepath):
10+
return open(filepath).read()
11+
else:
12+
return ''
813

914
def mecab_config(arg):
1015
return os.popen("mecab-config " + arg).readlines()[0].split()
@@ -17,9 +22,9 @@ def mecab_config(arg):
1722
swig_opts.extend("-I"+d for d in inc_dir)
1823

1924
setup(name = "mecab-python3",
20-
version = '0.8.2',
25+
version = '0.8.3',
2126
description = 'python wrapper for mecab: Morphological Analysis engine',
22-
long_description=readme,
27+
long_description= read_file('README.rst'),
2328
maintainer = 'Tatsuro Yasukawa',
2429
maintainer_email = '[email protected]',
2530
url = 'https://github.com/SamuraiT/mecab-python3',

0 commit comments

Comments
 (0)