@staticmethod<EOL><INDENT>def create(parser: Parser, obj: PersistedObject = None):<DEDENT>
if obj is not None:<EOL><INDENT>return _InvalidParserException('<STR_LIT>' + str(obj) + '<STR_LIT>' + str(parser) + '<STR_LIT>'<EOL>+ '<STR_LIT>' + obj.get_pretty_file_mode())<EOL><DEDENT>else:<EOL><INDENT>return _InvalidParserException('<STR_LIT>')<EOL><DEDENT>
Helper method provided because we actually can't put that in the constructor, it creates a bug in Nose tests
https://github.com/nose-devs/nose/issues/725

:param parser:
:param obj:
:return: