def _check_for_validation_errors(app=None):
    """Check that an app has no validation errors, and exit with errors if it does."""
    try:
        from cStringIO import StringIO
    except ImportError:
        from StringIO import StringIO
    s = StringIO()
    num_errors = get_validation_errors(s, app)
    if num_errors:
        if app:
            sys.stderr.write(style.ERROR(app % "Error: %s couldn't be installed, because there were errors in your model:\n"))
        else:
            sys.stderr.write(style.ERROR("Error: Couldn't install apps, because there were errors in one or more models:\n"))
        s.seek(0)
        sys.stderr.write(s.read())
        sys.exit(1)
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/django-0.96/django/core/management.py/_check_for_validation_errors/swapped operands of `%`