Salome HOME
projects
/
tools
/
sat.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix python3 and ElementTreePython3.py
[tools/sat.git]
/
src
/
debug.py
diff --git
a/src/debug.py
b/src/debug.py
index 8c24d5d90ee066f12be58ba6a89469c6f414b574..4d2eb0207685c78f88d4936b33fbd89ff9ea9193 100755
(executable)
--- a/
src/debug.py
+++ b/
src/debug.py
@@
-54,9
+54,20
@@
Show pretty print debug representation from instances of SAT classes
import os
import sys
import traceback
import os
import sys
import traceback
-import StringIO as SIO
import pprint as PP
import pprint as PP
+# Compatibility python 2/3 for unicode
+try:
+ _test = unicode
+except:
+ unicode = str
+
+# Compatibility python 2/3 for StringIO
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
+
_debug = [False] #support push/pop for temporary activate debug outputs
_user = os.environ['USER']
_debug = [False] #support push/pop for temporary activate debug outputs
_user = os.environ['USER']
@@
-168,7
+179,7
@@
def format_color_exception(msg, limit=None, trace=None):
# utilitaires divers pour debug
###############################################
# utilitaires divers pour debug
###############################################
-class OutStream(S
IO.S
tringIO):
+class OutStream(StringIO):
"""
utility class for pyconf.Config output iostream
"""
"""
utility class for pyconf.Config output iostream
"""
@@
-178,9
+189,9
@@
class OutStream(SIO.StringIO):
keep value before lost as self.value
"""
self.value = self.getvalue()
keep value before lost as self.value
"""
self.value = self.getvalue()
- S
IO.S
tringIO.close(self)
+ StringIO.close(self)
-class InStream(S
IO.S
tringIO):
+class InStream(StringIO):
"""utility class for pyconf.Config input iostream"""
pass
"""utility class for pyconf.Config input iostream"""
pass