Allow using warnings.warn()
with a Warning
#11959
Merged
warnings.warn()
with a Warning
#11959