Use thread.get_ident() instead (thanks @lndbrg)