Just raising `ImproperlyConfigured` here sounds okay to me, given the limited & internal use of this method.  Good catch.