Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chkcrontab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kevin Lyda
chkcrontab
Commits
6505b7b0
Commit
6505b7b0
authored
May 26, 2012
by
Kevin Lyda
Browse files
Options
Downloads
Patches
Plain Diff
Use a with statement.
parent
2a7214a3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
chkcrontab_lib.py
+10
-6
10 additions, 6 deletions
chkcrontab_lib.py
with
10 additions
and
6 deletions
chkcrontab_lib.py
+
10
−
6
View file @
6505b7b0
...
...
@@ -14,6 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# For Python 2.5
from
__future__
import
with_statement
"""
Processes crontab files and try to catch common errors.
Parse crontab files and check each type of line for potential syntax errors.
...
...
@@ -1024,7 +1027,8 @@ def CheckCrontab(crontab_file, log):
line_no
=
0
cron_line_factory
=
CronLineFactory
()
for
line
in
open
(
crontab_file
,
'
r
'
):
with
open
(
crontab_file
,
'
r
'
)
as
crontab_f
:
for
line
in
crontab_f
:
line
=
line
.
strip
()
line_no
+=
1
...
...
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