Recent Python3 versions seem to require this on Windows. Fixes bug 26535; bug copied from ntor_ref.py on 0.3.1.1-alpha.