Skip to content

Commit 7ac6449

Browse files
committed
uv tool run --python=3.12 --from=future futurize --stage1 --write .
1 parent 0887144 commit 7ac6449

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
#!/usr/bin/env jython
23
# NOTE: Jython is still Python 2.7 in late2020
34

@@ -6,4 +7,4 @@
67
message = Confidential('top secret text')
78
secret_field = Confidential.getDeclaredField('secret')
89
secret_field.setAccessible(True) # break the lock!
9-
print 'message.secret =', secret_field.get(message)
10+
print('message.secret =', secret_field.get(message))

capitulos/code/11-pythonic-obj/private/leakprivate.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from __future__ import print_function
12
#!/usr/bin/env jython
23
# NOTE: Jython is still Python 2.7 in late2020
34

@@ -10,5 +11,5 @@
1011
# list private fields only
1112
if Modifier.isPrivate(field.getModifiers()):
1213
field.setAccessible(True) # break the lock
13-
print 'field:', field
14-
print '\t', field.getName(), '=', field.get(message)
14+
print('field:', field)
15+
print('\t', field.getName(), '=', field.get(message))

capitulos/code/11-pythonic-obj/private/no_respect.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,12 @@
99
Set this to false and Jython provides access to non-public
1010
fields, methods, and constructors of Java objects.
1111
"""
12+
from __future__ import print_function
1213

1314
import Confidential
1415

1516
message = Confidential('top secret text')
1617
for name in dir(message):
1718
attr = getattr(message, name)
1819
if not callable(attr): # non-methods only
19-
print name + '\t=', attr
20+
print(name + '\t=', attr)

0 commit comments

Comments
 (0)