Doesn't this need to be `real_pgettext`? Or, alternately, don't you need to import `pgettext`? `import pgettext as real_pgettext` doesn't leave `pgettext` in the namespace.