[pytest] open exception file with mode for python3
authorEvan Shelhamer <shelhamer@imaginarynumber.net>
Thu, 6 Aug 2015 20:04:15 +0000 (13:04 -0700)
committerEvan Shelhamer <shelhamer@imaginarynumber.net>
Thu, 6 Aug 2015 20:04:15 +0000 (13:04 -0700)
python/caffe/test/test_python_layer.py

index ff070a3..a1e11bc 100644 (file)
@@ -43,7 +43,7 @@ def python_net_file():
 
 
 def exception_net_file():
-    with tempfile.NamedTemporaryFile(delete=False) as f:
+    with tempfile.NamedTemporaryFile(mode='w+', delete=False) as f:
         f.write("""name: 'pythonnet' force_backward: true
         input: 'data' input_shape { dim: 10 dim: 9 dim: 8 }
         layer { type: 'Python' name: 'layer' bottom: 'data' top: 'top'