0

Initial Python 3 port

Many things work, some don't. Notably, genPOI doesn't work, and
there's some signedness comparison stuff going on in the C extension.

This also completely drops support for Python 2, as maintaining a C
extension for both Python 2 and 3 is a pain and not worth it for the
9 months that Python 2 is still going to be supported upstream.

The documentation needs to be adjusted as well.

All of the few tests we have pass, and rendering a map works, both
with a configuration file and without. We can also use optimizeimages.

Concerns #1528.
This commit is contained in:
Nicolas F
2019-03-16 20:43:25 +01:00
parent 99eebd5b69
commit e348a548b6
33 changed files with 369 additions and 625 deletions

View File

@@ -144,7 +144,7 @@ class FileReplacer(object):
# error
try:
os.remove(self.tmpname)
except Exception, e:
except Exception as e:
logging.warning("An error was raised, so I was doing "
"some cleanup first, but I couldn't remove "
"'%s'!", self.tmpname)
@@ -153,7 +153,7 @@ class FileReplacer(object):
if self.caps.get("chmod_works") and os.path.exists(self.destname):
try:
shutil.copymode(self.destname, self.tmpname)
except OSError, e:
except OSError as e:
# Ignore errno ENOENT: file does not exist. Due to a race
# condition, two processes could conceivably try and update
# the same temp file at the same time
@@ -162,7 +162,7 @@ class FileReplacer(object):
# atomic rename into place
try:
os.rename(self.tmpname, self.destname)
except OSError, e:
except OSError as e:
# Ignore errno ENOENT: file does not exist. Due to a race
# condition, two processes could conceivably try and update
# the same temp file at the same time