aboutsummaryrefslogtreecommitdiffstats
path: root/tests/helpers.py
diff options
context:
space:
mode:
authorGravatar hedy <[email protected]>2024-04-06 15:13:34 +0800
committerGravatar hedy <[email protected]>2024-04-08 08:46:13 +0800
commitff1d3a8269a17956e9617c2ac69646fc1f29a00e (patch)
tree17d4ead31afa14efad67b111527c35d27383dc64 /tests/helpers.py
parentBump sentry-sdk from 1.44.0 to 1.44.1 (#3002) (diff)
Fix showing `!source` on tags when tags cog is reloaded
Previously the source command checks for the source object's class after getting it from the SourceType converter. When the tags cog is reloaded, TagIdentifier is redefined. We were checking whether the old TagIdentifier class (the `type()` of an instance of the old TagIdentifier) equals the newly defined TagIdentifier class. This returns false because the TagIdentifier class is redefined when the tags cog is reloaded, which caused tags, correctly identified by Source converter, to be unable to be identified in the source cog. The fix takes advantage of the fact that the source converter could correctly identify tags objects even after the tags cog reloads, and use enum comparisons rather than `isinstance`/`type()` to obtain the source type of whatever the source converter returns. Since we're no longer using the source converter as an actual converter, the function is moved to the source cog instead, and it still works fine.
Diffstat (limited to 'tests/helpers.py')
0 files changed, 0 insertions, 0 deletions