Fix import for collections Mapping

Mapping and other "abstract base classes" were moved after python 3.3 from collections to collections.abc
Python 3.3 is long gone and a newer version of python won't support this code.

(cherry picked from commit 7ec6392d46)
This commit is contained in:
Hristo Stamenov 2021-10-25 00:20:28 +03:00 committed by Rémi Verschelde
parent 4c76594e0d
commit d6ada73063
No known key found for this signature in database
GPG key ID: C3336907360768E1

View file

@ -1,11 +1,11 @@
import collections
import os import os
import re import re
import glob import glob
import subprocess import subprocess
from collections import OrderedDict from collections import OrderedDict
from compat import iteritems, isbasestring, open_utf8, decode_utf8, qualname from collections.abc import Mapping
from typing import Iterator from typing import Iterator
from compat import iteritems, isbasestring, open_utf8, decode_utf8, qualname
from SCons import Node from SCons import Node
from SCons.Script import ARGUMENTS from SCons.Script import ARGUMENTS
@ -675,7 +675,7 @@ def generate_vs_project(env, num_jobs):
batch_file = find_visual_c_batch_file(env) batch_file = find_visual_c_batch_file(env)
if batch_file: if batch_file:
class ModuleConfigs(collections.Mapping): class ModuleConfigs(Mapping):
# This version information (Win32, x64, Debug, Release, Release_Debug seems to be # This version information (Win32, x64, Debug, Release, Release_Debug seems to be
# required for Visual Studio to understand that it needs to generate an NMAKE # required for Visual Studio to understand that it needs to generate an NMAKE
# project. Do not modify without knowing what you are doing. # project. Do not modify without knowing what you are doing.