From 7a15d1b60c40f176d5c3b07f9942f4e9c1c777fe Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 13 Oct 2015 20:04:40 +1100 Subject: [PATCH] * Add Python 2/3 compatibility fix for copy_reg --- spacy/vocab.pyx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spacy/vocab.pyx b/spacy/vocab.pyx index 023d0bd89..aec01f239 100644 --- a/spacy/vocab.pyx +++ b/spacy/vocab.pyx @@ -11,7 +11,6 @@ import io import math import json import tempfile -import copy_reg from .lexeme cimport EMPTY_LEXEME from .lexeme cimport Lexeme @@ -29,6 +28,11 @@ from . import util from .serialize.packer cimport Packer from .attrs cimport PROB +try: + import copy_reg +except ImportError: + import copyreg as copy_reg + DEF MAX_VEC_SIZE = 100000