Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
athena
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
atlas
athena
Commits
4d4fca1b
Commit
4d4fca1b
authored
10 months ago
by
Frank Winklmeier
Browse files
Options
Downloads
Patches
Plain Diff
AthenaCommon: remove printfunc alias
parent
c39348e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!71094
2024-05-02: merge of 24.0 into main
,
!71021
AthenaCommon: remove printfunc alias
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Control/AthenaCommon/python/Include.py
+6
-10
6 additions, 10 deletions
Control/AthenaCommon/python/Include.py
Control/AthenaCommon/share/Execution.py
+3
-6
3 additions, 6 deletions
Control/AthenaCommon/share/Execution.py
with
9 additions
and
16 deletions
Control/AthenaCommon/python/Include.py
+
6
−
10
View file @
4d4fca1b
# Copyright (C) 2002-202
0
CERN for the benefit of the ATLAS collaboration
# Copyright (C) 2002-202
4
CERN for the benefit of the ATLAS collaboration
# File: AthenaCommon/python/Include.py
# Author: Wim Lavrijsen (WLavrijsen@lbl.gov)
...
...
@@ -7,10 +7,6 @@
JOBOPTSEARCHPATH envar and globally executed. If requested, files will be
traced. Note, however, that this option interferes with pdb and trace.
"""
# Don't want to use from __future__ import print_function here: that would
# then apply to everything that we read with include().
import
builtins
printfunc
=
getattr
(
builtins
,
'
print
'
)
import
os
,
sys
,
re
,
fnmatch
from
AthenaCommon.Utils.unixtools
import
FindFile
...
...
@@ -287,13 +283,13 @@ class Include( object ):
# formatted line printer
def
_oneline
(
self
,
fid
,
lineno
,
detail
,
buf
):
print
func
(
marker
,
fidMarker
%
fid
,
lineMarker
%
lineno
,
detail
,)
print
(
marker
,
fidMarker
%
fid
,
lineMarker
%
lineno
,
detail
,)
try
:
# simple eol case
if
not
buf
or
not
buf
[
lineno
]:
print
func
()
print
()
return
# in general, an interpreter "line" may be longer than a file line
...
...
@@ -302,18 +298,18 @@ class Include( object ):
# this line appears to have a continuation ...
try
:
# output traced line
print
func
(
line
)
print
(
line
)
# output continued line
lineno
+=
1
print
func
(
marker
,
fidMarker
%
fid
,
lineMarker
%
lineno
,
detail
,)
print
(
marker
,
fidMarker
%
fid
,
lineMarker
%
lineno
,
detail
,)
line
=
buf
[
lineno
].
rstrip
()
except
IndexError
:
# shouldn't happen; but must mean that the diagnosis above is
# wrong and that there is no continuation, keep silent
break
print
func
(
line
)
print
(
line
)
except
IndexError
:
log
.
warning
(
'
index (%d) out of range while scanning include file %d
'
,
lineno
,
fid
)
...
...
This diff is collapsed.
Click to expand it.
Control/AthenaCommon/share/Execution.py
+
3
−
6
View file @
4d4fca1b
import
builtins
printfunc
=
getattr
(
builtins
,
'
print
'
)
### execution of user script and drop into batch or interactive mode ---------
for
script
in
opts
.
scripts
:
try
:
...
...
@@ -22,9 +19,9 @@ for script in opts.scripts:
if
not
'
AthenaCommon
'
in
frame_info
[
0
]:
short_tb
.
append
(
frame_info
)
print
func
(
'
Shortened traceback (most recent user call last):
'
)
print
func
(
''
.
join
(
traceback
.
format_list
(
short_tb
)
),)
print
func
(
''
.
join
(
traceback
.
format_exception_only
(
exc_info
[
0
],
exc_info
[
1
]
)
),)
print
(
'
Shortened traceback (most recent user call last):
'
)
print
(
''
.
join
(
traceback
.
format_list
(
short_tb
)
),)
print
(
''
.
join
(
traceback
.
format_exception_only
(
exc_info
[
0
],
exc_info
[
1
]
)
),)
else
:
traceback
.
print_exc
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment