提交 19515765 authored 作者: Brandon T. Willard's avatar Brandon T. Willard

Remove Python 2.x support code

上级 6b3003fe
......@@ -17,8 +17,6 @@ import numpy as np
import theano
import theano.gof.cc
from six import PY3
from theano import config
from theano.gof import graph
from theano.gof import utils
......@@ -36,18 +34,6 @@ __docformat__ = "restructuredtext en"
_logger = logging.getLogger("theano.gof.op.Op")
# Open file in "universal newline mode".
# In Python 2, this is done by calling open(..., 'U'), but this is
# deprected in Python 3 (where we would need to pass "newline=None",
# which is the default).
if PY3:
_open_u = open
else:
def _open_u(file):
return open(file, "U")
def compute_test_value(node):
"""Computes the test value of a node.
......@@ -1349,7 +1335,7 @@ class COp(Op):
self.func_codes = []
for func_file in func_files:
# U (universal) will convert all new lines format to \n.
with _open_u(func_file) as f:
with open(func_file) as f:
self.func_codes.append(f.read())
# If both the old section markers and the new section markers are
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论