Skip to content

Commit

Permalink
better setuptools 74.0 fix
Browse files Browse the repository at this point in the history
  • Loading branch information
neworderofjamie committed Oct 9, 2024
1 parent 9c6f6f6 commit bd70f2a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pygenn/genn_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from os import path, environ
from platform import system
from psutil import cpu_count
from setuptools import msvc
from shutil import which
from subprocess import check_call # to call make
from textwrap import dedent
Expand Down Expand Up @@ -70,9 +69,17 @@

# If we're on windows
if system() == "Windows":
# Try import the helper to get Visual C++ environment from setuptools
# **NOTE** this was removed in version 74.0
try:
from setuptools.msvc import msvc14_get_vc_env as _get_vc_env
# If this fails, import from distutils
except ImportError:
from distutils._msvccompiler import _get_vc_env

# Get environment and cache in class, convertings
# all keys to upper-case for consistency
_msvc_env = msvc.msvc14_get_vc_env("x86_amd64")
_msvc_env = _get_vc_env("x86_amd64")
_msvc_env = {k.upper(): v for k, v in _msvc_env.items()}

# Update process's environment with this
Expand Down

0 comments on commit bd70f2a

Please sign in to comment.