Fix PyCrypto if using Python 3.

pull/17/head
Dave Page 2018-05-23 10:00:46 +01:00
parent 2c6938491e
commit dab5d94b7c
1 changed files with 6 additions and 0 deletions

View File

@ -245,6 +245,12 @@ REM Main build sequence Ends
ECHO Fixing backports.csv for Python 2 by adding missing __init__.py
type nul >> "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\backports\__init__.py"
)
IF %PYTHON_MAJOR% == 3 (
ECHO Fixing PyCrypto module for Python 3...
CALL "%PYTHON_HOME%\python" "%WD%\pkg\win32\replace.py" "-i" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py" "-o" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py.new" "-s" "import winrandom" -r "from . import winrandom"
MOVE /Y "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py.new" "%PGBUILDPATH%\%VIRTUALENV%\Lib\site-packages\Crypto\Random\OSRNG\nt.py"
)
ECHO Assembling runtime environment...
CD "%WD%\runtime"