SIGN IN SIGN UP

[3.13] gh-130851: Don't crash when deduping unusual code constants (GH-130853) (#130880)

The bytecode compiler only generates a few different types of constants,
like str, int, tuple, slices, etc. Users can construct code objects with
various unusual constants, including ones that are not hashable or not
even constant.

The free threaded build previously crashed with a fatal error when
confronted with these constants. Instead, treat distinct objects of
otherwise unhandled types as not equal for the purposes of deduplication.
(cherry picked from commit 2905690a91bf72cdf0fb919b5193849bb67732e2)

Co-authored-by: Sam Gross <colesbury@gmail.com>
M
Miss Islington (bot) committed
e285232c76606e3be7bf216efb1be1e742423e4b
Parent: 39f7b06
Committed by GitHub <noreply@github.com> on 3/5/2025, 8:22:57 PM