[bf] python 3 support