fix error class instantiation (#6634)

This commit is contained in:
Yohei Tamura
2020-09-02 20:36:32 +09:00
committed by GitHub
parent 4230d30f77
commit 485da7222f

View File

@@ -199,7 +199,7 @@ class MecabTokenizer:
try: try:
import fugashi import fugashi
except ModuleNotFoundError as error: except ModuleNotFoundError as error:
raise error( raise error.__class__(
"You need to install fugashi to use MecabTokenizer." "You need to install fugashi to use MecabTokenizer."
"See https://pypi.org/project/fugashi/ for installation." "See https://pypi.org/project/fugashi/ for installation."
) )
@@ -211,7 +211,7 @@ class MecabTokenizer:
try: try:
import ipadic import ipadic
except ModuleNotFoundError as error: except ModuleNotFoundError as error:
raise error( raise error.__class__(
"The ipadic dictionary is not installed. " "The ipadic dictionary is not installed. "
"See https://github.com/polm/ipadic-py for installation." "See https://github.com/polm/ipadic-py for installation."
) )
@@ -222,7 +222,7 @@ class MecabTokenizer:
try: try:
import unidic_lite import unidic_lite
except ModuleNotFoundError as error: except ModuleNotFoundError as error:
raise error( raise error.__class__(
"The unidic_lite dictionary is not installed. " "The unidic_lite dictionary is not installed. "
"See https://github.com/polm/unidic-lite for installation." "See https://github.com/polm/unidic-lite for installation."
) )
@@ -233,7 +233,7 @@ class MecabTokenizer:
try: try:
import unidic import unidic
except ModuleNotFoundError as error: except ModuleNotFoundError as error:
raise error( raise error.__class__(
"The unidic dictionary is not installed. " "The unidic dictionary is not installed. "
"See https://github.com/polm/unidic-py for installation." "See https://github.com/polm/unidic-py for installation."
) )