Fix further Python 2 issues

6 jobs for master in 4545 minutes and 27 seconds (queued for 3 seconds)
Name Stage Failure
failed
job_gcc_amd64 Test There is an unknown failure, please try again
  max_open_warning, RuntimeWarning)
/usr/lib/python3.5/site-packages/matplotlib/pyplot.py:516: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
max_open_warning, RuntimeWarning)
/usr/lib/python3.5/site-packages/matplotlib/pyplot.py:516: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
max_open_warning, RuntimeWarning)
/usr/lib/python3.5/site-packages/matplotlib/tight_layout.py:222: UserWarning: tight_layout : falling back to Agg renderer
warnings.warn("tight_layout : falling back to Agg renderer")

ERROR: Build failed: exit status 1
failed
job_clang_amd64 Test There is an unknown failure, please try again
  max_open_warning, RuntimeWarning)
<string>:17: RuntimeWarning: divide by zero encountered in log
/usr/lib/python3.5/site-packages/matplotlib/pyplot.py:516: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
max_open_warning, RuntimeWarning)
/usr/lib/python3.5/site-packages/matplotlib/pyplot.py:516: RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (`matplotlib.pyplot.figure`) are retained until explicitly closed and may consume too much memory. (To control this warning, see the rcParam `figure.max_open_warning`).
max_open_warning, RuntimeWarning)
<string>:10: VisibleDeprecationWarning: using a non-integer number instead of an integer will result in an error in the future

ERROR: Build failed: exit status 1
failed
job_gcc_py2_amd64 Test There is an unknown failure, please try again
    import test_inference_mcmc
Expected:
OK
Got:
Warning, distributions for directed=False (c1, c2) = (0.01, inf) are not the same, with a p-value: 0.0006037 (D=0.0888623)
OK

Session terminated, killing shell...
ERROR: Build failed: aborted: terminated
failed
job_clang_py2_amd64 Test There is an unknown failure, please try again
    import test_inference_mcmc
Expected:
OK
Got:
Warning, distributions for directed=False (c1, c2) = (0.01, inf) are not the same, with a p-value: 0.0006037 (D=0.0888623)
OK

Session terminated, killing shell...
ERROR: Build failed: aborted: terminated
failed
job_gcc_amd64_nosh Test There is an unknown failure, please try again
    import test_inference_mcmc
Expected:
OK
Got:
Warning, distributions for directed=False (c1, c2) = (0.01, inf) are not the same, with a p-value: 0.0006037 (D=0.0888623)
OK

Session terminated, killing shell...
ERROR: Build failed: aborted: terminated
failed
job_clang_amd64_nosh Test There is an unknown failure, please try again
  22 tests in default
22 tests in 1 items.
22 passed and 0 failed.
Test passed.

Document: inference
-------------------

ERROR: Build failed: aborted: terminated