[asymptote] 12/16: Fix more incompatibilities with python3.
This is an automated email from the git hooks/post-receive script.
preining pushed a commit to branch master
in repository asymptote.
commit 9ee2acbc74cf2e74e861e6eaeadedf0b2a795e51
Author: Nicolas Boulenguez <nicolas@debian.org>
Date: Tue Oct 31 11:33:01 2017 +0100
Fix more incompatibilities with python3.
---
debian/patches/python3_nonintrusive.diff | 82 ++++++++++++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 83 insertions(+)
diff --git a/debian/patches/python3_nonintrusive.diff b/debian/patches/python3_nonintrusive.diff
new file mode 100644
index 0000000..b04a6e5
--- /dev/null
+++ b/debian/patches/python3_nonintrusive.diff
@@ -0,0 +1,82 @@
+Description: fix incompatibilities between python2 to python3
+ Most of the work has already been done upstream.
+Author: Nicolas Boulenguez <nicolas@debian.org>
+
+--- a/aspy.py
++++ b/aspy.py
+@@ -339,7 +339,7 @@
+
+ return DatumFromHandle(h)
+
+-print "version", policy.contents.version
++print ("version", policy.contents.version)
+
+ state = State(baseState)
+
+--- a/base/asymptote.py
++++ b/base/asymptote.py
+@@ -23,10 +23,10 @@
+ def erase(self):
+ self.send("erase();")
+ def help(self):
+- print "Asymptote session is open. Available methods are:"
+- print " help(), size(int), draw(str), fill(str), clip(str), label(str), shipout(str), send(str), erase()"
++ print ("Asymptote session is open. Available methods are:")
++ print (" help(), size(int), draw(str), fill(str), clip(str), label(str), shipout(str), send(str), erase()")
+ def __del__(self):
+- print "closing Asymptote session..."
++ print ("closing Asymptote session...")
+ self.send('quit');
+ self.session.stdin.close();
+ self.session.wait()
+@@ -43,6 +43,9 @@
+ g.fill("unitsquare, blue")
+ g.clip("unitcircle")
+ g.label("\"$O$\", (0,0), SW")
+- raw_input("press ENTER to continue")
++ if sys.version_info >= (3, 0):
++ input ("press ENTER to continue")
++ else:
++ raw_input ("press ENTER to continue")
+ g.erase()
+ del g
+--- a/profile.py
++++ b/profile.py
+@@ -30,8 +30,8 @@
+ + sum(child['nsecsTotal'] for child in tree['children']))
+
+ def printName(name, prefix=''):
+- print prefix+"fl=", name[1]
+- print prefix+"fn=", name[0]
++ print (prefix+"fl=", name[1])
++ print (prefix+"fn=", name[0])
+
+ class Arc:
+ def __init__(self):
+@@ -61,13 +61,13 @@
+ self.addChildTime(child)
+
+ def dump(self):
+- print POS, self.instructions, self.nsecs
++ print (POS, self.instructions, self.nsecs)
+ for name in self.arcs:
+ printName(name, prefix='c')
+ arc = self.arcs[name]
+- print "calls="+str(arc.calls), POS
+- print POS, arc.instTotal, arc.nsecsTotal
+- print
++ print ("calls="+str(arc.calls), POS)
++ print (POS, arc.instTotal, arc.nsecsTotal)
++ print ()
+
+ def analyse(funcs, tree):
+ funcs[nameFromNode(tree)].analyse(tree)
+@@ -75,7 +75,7 @@
+ analyse(funcs, child)
+
+ def dump(funcs):
+- print "events: Instructions Nanoseconds"
++ print ("events: Instructions Nanoseconds")
+ for name in funcs:
+ printName(name)
+ funcs[name].dump()
diff --git a/debian/patches/series b/debian/patches/series
index 5d85c57..4e58be6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
honour-source-date-epoch
#upstream-2f209f9e-fix-for-tl2016
typos.diff
+python3_nonintrusive.diff
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-tex/asymptote.git
Reply to: