Browse Source

port reportbug.testfile to py3k

master
Sandro Tosi 6 years ago
parent
commit
e1f670432d
  1. 4
      reportbug/tempfiles.py
  2. 4
      test/test_tempfiles.py

4
reportbug/tempfiles.py

@ -56,9 +56,9 @@ if hasattr(os, 'O_BINARY'):
# Based on python-1.5.2/Lib/tempfile.py
def open_write_safe(filename, mode='w+b', bufsize=-1):
if 'b' in mode:
fd = os.open(filename, _bin_openflags, 0600)
fd = os.open(filename, _bin_openflags, 0o600)
else:
fd = os.open(filename, _text_openflags, 0600)
fd = os.open(filename, _text_openflags, 0o600)
try:
return os.fdopen(fd, mode, bufsize)

4
test/test_tempfiles.py

@ -1,10 +1,10 @@
import unittest2
import unittest
from reportbug import tempfiles
import os.path
class TestTempfiles(unittest2.TestCase):
class TestTempfiles(unittest.TestCase):
def test_tempfile_prefix(self):
extra = 'dummystring'

Loading…
Cancel
Save