fixed Issue #409

1.  resolve the compatibility problem of python3 
2.  fixed Issue #409