Skip to content

Commit

Permalink
Check swig is installed
Browse files Browse the repository at this point in the history
Display an error message is swig is not installed.

I hope it will be clearer than the default error message:
error: command 'swig' failed: No such file or directory
  • Loading branch information
LudovicRousseau committed Aug 11, 2023
1 parent 05ea537 commit 5f3a828
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

from setuptools import setup, Extension
from setuptools.command.build_py import build_py
from distutils.spawn import find_executable


platform_include_dirs = []
Expand Down Expand Up @@ -64,6 +65,11 @@
except:
platform_include_dirs = ['/usr/include/PCSC', '/usr/local/include/PCSC']

if find_executable("swig") is None:
print("Install swig and try again")
print("")
sys.exit(1)

VERSION_INFO = (2, 0, 7, 0)
VERSION_STR = '%i.%i.%i' % VERSION_INFO[:3]
VERSION_ALT = '%i,%01i,%01i,%04i' % VERSION_INFO
Expand Down

0 comments on commit 5f3a828

Please sign in to comment.