summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-20 15:20:55 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-20 15:20:55 -0400
commit377d1957677c7af631f054fabc3331ee5d57ae36 (patch)
treec888f8c91dec64df8e64d1bc403fd46f015c7c2d /src/lib
parent2e4d3a900e8f448363c1d2d95aa9966bb5abe671 (diff)
downloadbcfg2-377d1957677c7af631f054fabc3331ee5d57ae36.tar.gz
bcfg2-377d1957677c7af631f054fabc3331ee5d57ae36.tar.bz2
bcfg2-377d1957677c7af631f054fabc3331ee5d57ae36.zip
py3k unicode fixes
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Bcfg2/Bcfg2Py3k.py5
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/File.py5
2 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Bcfg2/Bcfg2Py3k.py b/src/lib/Bcfg2/Bcfg2Py3k.py
index 784ac118f..640efff95 100644
--- a/src/lib/Bcfg2/Bcfg2Py3k.py
+++ b/src/lib/Bcfg2/Bcfg2Py3k.py
@@ -78,6 +78,11 @@ def u_str(string, encoding=None):
return unicode(string)
try:
+ unicode = str
+except:
+ unicode = unicode
+
+try:
input = raw_input
except:
input = input
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/File.py b/src/lib/Bcfg2/Client/Tools/POSIX/File.py
index 9c5697162..1b5535d28 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/File.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/File.py
@@ -6,10 +6,7 @@ import difflib
import binascii
import tempfile
from base import POSIXTool
-
-# py3k compatibility
-if sys.hexversion >= 0x03000000:
- unicode = str
+from Bcfg2.Bcfg2Py3k import unicode
class POSIXFile(POSIXTool):
__req__ = ['name', 'perms', 'owner', 'group']