Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
78686b2b
Commit
78686b2b
authored
Apr 05, 2024
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixup! data_notebook: py3
parent
1fc03b21
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
...teItem/portal_components/extension.erp5.JupyterCompile.py
+7
-3
No files found.
bt5/erp5_data_notebook/ExtensionTemplateItem/portal_components/extension.erp5.JupyterCompile.py
View file @
78686b2b
...
...
@@ -618,9 +618,9 @@ class CustomPrint(object):
def
write
(
self
,
*
args
):
# BBB PY2
self
.
captured_output_list
+=
args
def
__call__
(
self
,
*
args
,
end
=
"
\
n
"
,
**
kw
):
def
__call__
(
self
,
*
args
,
**
kw
):
self
.
captured_output_list
.
extend
(
args
)
self
.
captured_output_list
.
append
(
end
)
self
.
captured_output_list
.
append
(
kw
.
get
(
"end"
,
"
\
n
"
)
)
def
getCapturedOutputString
(
self
):
return
''
.
join
(
str
(
o
)
for
o
in
self
.
captured_output_list
)
...
...
@@ -918,7 +918,7 @@ class ImportFixer(ast.NodeTransformer):
empty_function
=
self
.
newEmptyFunction
(
"%s_setup"
%
dotless_result_name
)
return_dict
=
self
.
newReturnDict
(
final_module_names
)
if
star_import_used
:
if
s
ix
.
PY3
and
s
tar_import_used
:
# since we are generating a function on the fly, we can not generate something
# like this, because star import are only allowed at module level:
# def f():
...
...
@@ -926,6 +926,10 @@ class ImportFixer(ast.NodeTransformer):
# in that case we transform the ast to something like:
# def f():
# from mod import a, b, c
#
# this would be more correct to do it on python 2, but this triggers an error
# ( AttributeError: 'alias' object has no attribute 'asname' ) in astor codegen,
# so we ignore this on python 2.
node
.
names
=
[
ast
.
alias
(
name
=
n
)
for
n
in
final_module_names
]
empty_function
.
body
=
[
node
,
return_dict
]
environment_set
=
self
.
newEnvironmentSetCall
(
"%s_setup"
%
dotless_result_name
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment