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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
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
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
erp5
Commits
969c3e23
Commit
969c3e23
authored
Oct 29, 2019
by
Arnaud Fontaine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ZODB Components: checkPythonSourceCode(): AST object of temp file was never GC'ed.
parent
1cb2dc4c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
product/ERP5Type/Utils.py
product/ERP5Type/Utils.py
+9
-2
product/ERP5Type/tests/testDynamicClassGeneration.py
product/ERP5Type/tests/testDynamicClassGeneration.py
+2
-1
No files found.
product/ERP5Type/Utils.py
View file @
969c3e23
...
...
@@ -468,7 +468,8 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
message_list
=
[]
output_file
=
cStringIO
.
StringIO
()
try
:
with
tempfile
.
NamedTemporaryFile
(
suffix
=
'.py'
)
as
input_file
:
with
tempfile
.
NamedTemporaryFile
(
prefix
=
'checkPythonSourceCode'
,
suffix
=
'.py'
)
as
input_file
:
input_file
.
write
(
source_code_str
)
input_file
.
flush
()
...
...
@@ -522,7 +523,13 @@ def checkPythonSourceCode(source_code_str, portal_type=None):
args
.
append
(
'--load-plugins='
+
ext
)
except
ImportError
:
pass
try
:
Run
(
args
,
reporter
=
TextReporter
(
output_file
),
exit
=
False
)
finally
:
from
astroid.builder
import
MANAGER
MANAGER
.
astroid_cache
.
pop
(
os
.
path
.
splitext
(
os
.
path
.
basename
(
input_file
.
name
))[
0
],
None
)
output_file
.
reset
()
for
line
in
output_file
:
...
...
product/ERP5Type/tests/testDynamicClassGeneration.py
View file @
969c3e23
...
...
@@ -2149,7 +2149,8 @@ def function_foo(*args, **kwargs):
from
astroid.builder
import
MANAGER
should_not_be_in_cache_list
=
[]
for
modname
in
MANAGER
.
astroid_cache
:
if
modname
in
must_not_be_in_cache_set
:
if
(
modname
.
startswith
(
'checkPythonSourceCode'
)
or
modname
in
must_not_be_in_cache_set
):
should_not_be_in_cache_list
.
append
(
modname
)
if
modname
in
must_be_in_cache_set
:
...
...
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