summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--QMTest/TestCmd.py2
-rw-r--r--src/engine/SCons/Script/SConsOptions.py15
2 files changed, 15 insertions, 2 deletions
diff --git a/QMTest/TestCmd.py b/QMTest/TestCmd.py
index 370101bb..96e07a98 100644
--- a/QMTest/TestCmd.py
+++ b/QMTest/TestCmd.py
@@ -783,7 +783,7 @@ class Popen(subprocess.Popen):
return 0
try:
- written = os.write(self.stdin.fileno(), input)
+ written = os.write(self.stdin.fileno(), bytearray(input,'utf-8'))
except OSError as why:
if why.args[0] == errno.EPIPE: #broken pipe
return self._close('stdin')
diff --git a/src/engine/SCons/Script/SConsOptions.py b/src/engine/SCons/Script/SConsOptions.py
index 501e4cef..288a7a5a 100644
--- a/src/engine/SCons/Script/SConsOptions.py
+++ b/src/engine/SCons/Script/SConsOptions.py
@@ -63,6 +63,7 @@ def diskcheck_convert(value):
raise ValueError(v)
return result
+
class SConsValues(optparse.Values):
"""
Holder class for uniform access to SCons options, regardless
@@ -112,7 +113,18 @@ class SConsValues(optparse.Values):
try:
return self.__dict__['__SConscript_settings__'][attr]
except KeyError:
- return getattr(self.__dict__['__defaults__'], attr)
+ try:
+ return getattr(self.__dict__['__defaults__'], attr)
+ except KeyError:
+ # Added because with py3 this is a new class,
+ # not a classic class, and due to the way
+ # In that case it will create an object without
+ # __defaults__, and then query for __setstate__
+ # which will throw an exception of KeyError
+ # deepcopy() is expecting AttributeError if __setstate__
+ # is not available.
+ raise AttributeError(attr)
+
settable = [
'clean',
@@ -186,6 +198,7 @@ class SConsValues(optparse.Values):
self.__SConscript_settings__[name] = value
+
class SConsOption(optparse.Option):
def convert_value(self, opt, value):
if value is not None: