From 6ace81b25d700e2c570eb6760b27e92a57e4e7c4 Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Mon, 15 Jul 2019 15:37:48 +0000 Subject: [PATCH] Corrected the order of string prefix 'r' and 'b' under python2. - Legacy-Id: 16445 --- ietf/utils/validators.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ietf/utils/validators.py b/ietf/utils/validators.py index c982fccfa..8ad5a6466 100644 --- a/ietf/utils/validators.py +++ b/ietf/utils/validators.py @@ -1,7 +1,9 @@ -# -*- python -*- # Copyright The IETF Trust 2016-2019, All Rights Reserved +# -*- coding: utf-8 -*- +from __future__ import absolute_import, print_function, unicode_literals + import os import re import magic @@ -77,7 +79,7 @@ def validate_mime_type(file, valid): mime_type, encoding = get_mime_type(raw) # work around mis-identification of text where a line has 'virtual' as # the first word: - if mime_type == 'text/x-c++' and re.search(rb'(?m)^virtual\s', raw): + if mime_type == 'text/x-c++' and re.search(br'(?m)^virtual\s', raw): mod = raw.replace(b'virtual', b' virtual') mime_type, encoding = get_mime_type(mod) if valid and not mime_type in valid: