Skip to content

Commit 2ba6235

Browse files
authored
Update testing_util.py
The improved evaluation framework for standard_input in CODE_TYPE has addressed the following bugs: - Wildcard Imports Conflict: The framework now properly handles code containing from [module_name] import * to avoid issues. For example: import time a = 1 from math import * print(a + 1) Previously, this would be evaluated as: import time def code(): a = 1 from math import * # Error leading to errors. - Name Conflicts with os** Module**: Fixed the runtime error caused by from os import * when it conflicts with the variable name name in the code. - FastIO Implementations: The framework now supports code with FastIO implementations that utilize the fileno() attribute of IOBase. - IOStream Operations: Improved handling of code that reads input and writes output using IOStream. - File-Based Input and Output: The framework can now correctly evaluate code that reads input from input.txt and writes output to output.txt.
1 parent 81df310 commit 2ba6235

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

metrics/testing_util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# modifed from https://github.com/hendrycks/apps/blob/main/eval/testing_util.py to fix some evaluation bugs
1+
# modifed from https://github.com/hendrycks/apps/blob/main/eval/testing_util.py to fix some evaluation bugs and add instructions
22

33
from .pyext2 import RuntimeModule
44
import signal

0 commit comments

Comments
 (0)