The upstream patch [0] is not very clear due to the fact the contributor also changed the indentation and other PEP8-related in the same commit. The easiest way to fix it is to version bump to that commit [0]. Otherwise, more information about the actual fix can be retrieved from the first comment of the related PR [1]. [0] https://github.com/SecureAuthCorp/impacket/commit/49c643bf66620646884ed141c94e5fdd85bcdd2f [1] https://github.com/SecureAuthCorp/impacket/pull/1066#issue-622746179