Permalink
Browse files

Added support for Python3 for the defines scripts

  • Loading branch information...
1 parent 2b432d4 commit bc56548a640f37489bdf4071edf43c5c3c7aa7a0 @ereOn ereOn committed Nov 1, 2015
Showing with 4 additions and 4 deletions.
  1. +4 −4 defines.py
View
@@ -42,7 +42,7 @@ def repository_root(self):
except (CalledProcessError, OSError):
self._repository_root = os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe())))
- return self._repository_root
+ return self._repository_root.decode('utf-8')
@property
def repository_version(self):
@@ -136,17 +136,17 @@ def generate_defines(self, target):
Generate the defines.hpp file.
"""
- with open(self.template_file_path, 'rb') as source_file:
+ with open(self.template_file_path, 'r') as source_file:
output = self.replace_template_variables(source_file.read())
try:
- with open(target, 'rb') as target_file:
+ with open(target, 'r') as target_file:
current_content = target_file.read()
except IOError:
current_content = None
if output != current_content:
- with open(target, 'wb') as target_file:
+ with open(target, 'w') as target_file:
target_file.write(output)
if __name__ == '__main__':

0 comments on commit bc56548

Please sign in to comment.