Adapting PR 441 to verion 7.0 to fix setup.py