Carla settings python2-3

This commit is contained in:
felipecode 2017-11-20 15:35:45 +01:00
parent b2feef5964
commit 406f67cfe7
1 changed files with 8 additions and 6 deletions

View File

@ -9,15 +9,16 @@
import io
import random
import sys
try:
from configparser import ConfigParser
except ImportError:
import sys
is_py2 = sys.version[0] == '2'
if is_py2:
from ConfigParser import RawConfigParser as ConfigParser
else:
from configparser import ConfigParser
MAX_NUMBER_OF_WEATHER_IDS = 14
@ -143,5 +144,6 @@ class CarlaSettings(object):
text = io.StringIO()
else:
text = io.BytesIO()
ini.write(text)
return text.getvalue().replace(' = ', '=')