mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
Apply modernize transform libmodernize.fixes.fix_file.
This replaces use of file() with open() which is python 3 compatible, and also adds it to our python 3 support test suite.
This commit is contained in:
@@ -12,7 +12,7 @@ from zerver.lib.user_agent import parse_user_agent
|
||||
user_agents_parsed = defaultdict(int)
|
||||
user_agents_path = os.path.join(os.path.dirname(__file__), "user_agents_unique")
|
||||
parse_errors = 0
|
||||
for line in file(user_agents_path).readlines():
|
||||
for line in open(user_agents_path).readlines():
|
||||
line = line.strip()
|
||||
match = re.match('^(?P<count>[0-9]+) "(?P<user_agent>.*)"$', line)
|
||||
if match is None:
|
||||
|
||||
Reference in New Issue
Block a user