summaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRaphaël Barrois <raphael.barrois@polyconseil.fr>2013-12-25 01:20:08 +0100
committerRaphaël Barrois <raphael.barrois@polyconseil.fr>2013-12-25 01:20:08 +0100
commitb2c15880cc0bfe9a0c149ce3124813e95e8592b0 (patch)
tree86a76c94e6cc772912a40d6b79ab5365a8f74d47 /setup.py
parent7ca7d10e6119061128655dcea5a484ad551441b3 (diff)
downloadfactory-boy-b2c15880cc0bfe9a0c149ce3124813e95e8592b0.tar
factory-boy-b2c15880cc0bfe9a0c149ce3124813e95e8592b0.tar.gz
Packaging: Use codecs.open (Closes #114, #118).
Diffstat (limited to 'setup.py')
-rwxr-xr-xsetup.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index 1154061..54e4caa 100755
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
+import codecs
import os
import re
import sys
@@ -13,8 +14,8 @@ root_dir = os.path.abspath(os.path.dirname(__file__))
def get_version(package_name):
version_re = re.compile(r"^__version__ = [\"']([\w_.-]+)[\"']$")
package_components = package_name.split('.')
- path_components = package_components + ['__init__.py']
- with open(os.path.join(root_dir, *path_components)) as f:
+ init_path = os.path.join(root_dir, *(package_components + ['__init__.py']))
+ with codecs.open(init_path, 'r', 'utf-8') as f:
for line in f:
match = version_re.match(line[:-1])
if match: