File tree Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Expand file tree Collapse file tree 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 1818"""
1919
2020import gc
21- import imp
22- import os
23- import sys
21+ import importlib
22+ import pkgutil
2423import time
2524
26- parentPath = os .path .abspath (".." )
27- if parentPath not in sys .path :
28- sys .path .insert (0 , parentPath )
2925import diff_match_patch as dmp_module
3026
3127# Force a module reload. Allows one to edit the DMP module and rerun the test
3228# without leaving the Python interpreter.
33- imp .reload (dmp_module )
29+ importlib .reload (dmp_module )
3430
3531
3632def 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 ()
3935
4036 dmp = dmp_module .diff_match_patch ()
4137 dmp .Diff_Timeout = 0.0
You can’t perform that action at this time.
0 commit comments