Skip to content

Commit c0408e3

Browse files
authored
Merge pull request #63 from openalea/53-release-2025-invalid-mode-ru
Invalid mode rU
2 parents 54990d8 + 0d1dbad commit c0408e3

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

doc/user/subtelties.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ It can then be instantiated in the axiom and modified during the simulation::
1818
Axiom: Apex(ApexParameters(age=0))
1919
dt = 1
2020
derivation length: 2
21+
production:
2122
Apex(p) :
2223
p.age += dt
2324
produce Node() Apex(p)
@@ -26,12 +27,12 @@ Creating the lsystem and running it the first time will produce the expected res
2627

2728
>>> l = Lsystem('mycode.lpy')
2829
>>> lstring = l.derive()
29-
>>> print lstring
30+
>>> print(lstring)
3031
Node()Node()Apex(ApexParameters(age=2))
3132

3233
However, a strange behavior occurs when asking for the axiom.::
3334

34-
>>> print l.axiom
35+
>>> print(l.axiom)
3536
Apex(ApexParameters(age=2))
3637

3738
In fact, this behavior is due to the way python manage object. By default, complex objects
@@ -40,7 +41,7 @@ are not copied but simply shared between variables.::
4041
>>> a = ApexParameters(age=0)
4142
>>> b = a
4243
>>> b.age = 2
43-
>>> print a.age
44+
>>> print(a.age)
4445
2
4546

4647
The variables ``b`` and ``a`` point toward the same object in memory. This one will be destroyed only when no variable

src/openalea/lpy/gui/simulation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def open(self,fname):
355355
elif answer == QMessageBox.Discard:
356356
os.remove(bckupname)
357357
os.chdir(os.path.dirname(self.fname))
358-
code = open(readname,'rU').read()
358+
code = open(readname,'r').read()
359359
self.readonly = (not os.access(fname, os.W_OK))
360360
self.textedition = recovery
361361
self.setEdited(recovery)
@@ -367,7 +367,7 @@ def importtmpfile(self,fname):
367367
self.textedition = True
368368
self.setEdited(True)
369369
try:
370-
lpycode = open(fname,'rU').read()
370+
lpycode = open(fname,'r').read()
371371
self.opencode(lpycode)
372372
self._tmpfname = fname
373373
except:

0 commit comments

Comments
 (0)