scripts: Use backport of a recent Python3 configparser on Python2

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2021-10-04 15:09:10 -04:00
parent 41d42a07bf
commit cc63fd51b2
2 changed files with 2 additions and 7 deletions

View File

@ -98,16 +98,10 @@ def setup_python2_wrappers():
if sys.version_info.major >= 3: if sys.version_info.major >= 3:
return return
# Add module hacks so that common Python3 module imports work in Python2 # Add module hacks so that common Python3 module imports work in Python2
import Queue, io, StringIO, ConfigParser, time import Queue, io, StringIO, time
sys.modules["queue"] = Queue sys.modules["queue"] = Queue
io.StringIO = StringIO.StringIO io.StringIO = StringIO.StringIO
time.process_time = time.clock time.process_time = time.clock
sys.modules["configparser"] = ConfigParser
OrigRawConfigParser = ConfigParser.RawConfigParser
def RCP(strict=False, *args, **kwargs):
return OrigRawConfigParser(*args, **kwargs)
RCP.SECTCRE = OrigRawConfigParser.SECTCRE
ConfigParser.RawConfigParser = RCP
setup_python2_wrappers() setup_python2_wrappers()

View File

@ -7,3 +7,4 @@ pyserial==3.4
greenlet==1.1.2 greenlet==1.1.2
Jinja2==2.11.3 Jinja2==2.11.3
python-can==3.3.4 python-can==3.3.4
configparser==4.0.2