py3: Fix thread import
py3: Use '0o' octal literal