Skip to content

Commit 8640b2c

Browse files
committed
Remove b mode from files
This does not work well with python 3. Besides, most of these files are just there for unit tests, so this is not so important
1 parent 3192f90 commit 8640b2c

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

pygccxml/declarations/decl_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,5 +504,5 @@ def dump_declarations(declarations, file_path):
504504
505505
"""
506506

507-
with open(file_path, "wb+") as f:
507+
with open(file_path, "w+") as f:
508508
print_declarations(declarations, writer=f.write)

unittests/file_cache_tester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def test_update(self):
5353
# We wrote a //touch in the header file. Just replace the file with the
5454
# original content. The touched file would be sometimes commited by
5555
# error as it was modified.
56-
with open(self.header, "wb") as new_header:
56+
with open(self.header, "w") as new_header:
5757
new_header.write(content)
5858

5959
def test_from_file(self):

unittests/project_reader_correctness_tester.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,9 @@ def __test_correctness_impl(self, file_name):
4141
s = src_decls[0]
4242
p = prj_decls[0]
4343
bdir = autoconfig.build_directory
44-
with open(os.path.join(bdir, file_name + '.sr.txt'), 'wb+') as sr:
44+
with open(os.path.join(bdir, file_name + '.sr.txt'), 'w+') as sr:
4545
with open(
46-
os.path.join(bdir, file_name + '.pr.txt'),
47-
'wb+') as pr:
46+
os.path.join(bdir, file_name + '.pr.txt'), 'w+') as pr:
4847

4948
declarations.print_declarations(
5049
s, writer=lambda l: sr.write(l + os.linesep))

0 commit comments

Comments
 (0)