File tree 1 file changed +5
-9
lines changed
1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 18
18
"""
19
19
20
20
import gc
21
- import imp
22
- import os
23
- import sys
21
+ import importlib
22
+ import pkgutil
24
23
import time
25
24
26
- parentPath = os .path .abspath (".." )
27
- if parentPath not in sys .path :
28
- sys .path .insert (0 , parentPath )
29
25
import diff_match_patch as dmp_module
30
26
31
27
# Force a module reload. Allows one to edit the DMP module and rerun the test
32
28
# without leaving the Python interpreter.
33
- imp .reload (dmp_module )
29
+ importlib .reload (dmp_module )
34
30
35
31
36
32
def main ():
37
- text1 = open ( " speedtest1.txt" ).read ()
38
- text2 = open ( " speedtest2.txt" ).read ()
33
+ text1 = pkgutil . get_data ( "diff_match_patch.tests" , " speedtest1.txt" ).decode ()
34
+ text2 = pkgutil . get_data ( "diff_match_patch.tests" , " speedtest2.txt" ).decode ()
39
35
40
36
dmp = dmp_module .diff_match_patch ()
41
37
dmp .Diff_Timeout = 0.0
You can’t perform that action at this time.
0 commit comments