File tree Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Expand file tree Collapse file tree 1 file changed +3
-5
lines changed Original file line number Diff line number Diff line change 1
1
from collections import OrderedDict
2
2
import re
3
+ import pickle
3
4
4
5
from .exceptions import JsonSchemaValueException , JsonSchemaDefinitionException
5
6
from .indent import indent
@@ -100,15 +101,12 @@ def global_state_code(self):
100
101
'' ,
101
102
'' ,
102
103
])
103
- regexs = ['"{}": re.compile(r"{}")' .format (key , value .pattern ) for key , value in self ._compile_regexps .items ()]
104
104
return '\n ' .join (self ._extra_imports_lines + [
105
- 'import re' ,
105
+ 'import re, pickle ' ,
106
106
'from fastjsonschema import JsonSchemaValueException' ,
107
107
'' ,
108
108
'' ,
109
- 'REGEX_PATTERNS = {' ,
110
- ' ' + ',\n ' .join (regexs ),
111
- '}' ,
109
+ 'REGEX_PATTERNS = pickle.loads(' + str (pickle .dumps (self ._compile_regexps )) + ')' ,
112
110
'' ,
113
111
])
114
112
You can’t perform that action at this time.
0 commit comments