Skip to content

Commit

Permalink
Handle no-output generator corner case; #295
Browse files Browse the repository at this point in the history
  • Loading branch information
Xyene committed Dec 8, 2017
1 parent 554eb03 commit ce18c18
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dmoj/problem.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from __future__ import print_function
from __future__ import print_function
import os
import subprocess
import zipfile
Expand Down Expand Up @@ -161,6 +159,8 @@ def io_redirects(self):
return filtered_data

def _normalize(self, data):
# Perhaps the correct answer may be "no output", in which case it'll be None here if
# sourced from a generator
data = data or ''
# Normalize all newline formats (\r\n, \r, \n) to \n, otherwise we have problems with people creating
# data on Macs (\r newline) when judged programs assume \n
Expand Down

0 comments on commit ce18c18

Please sign in to comment.