Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[py2py3] Modernization of last files left out up to now #10768

Merged
merged 2 commits into from
Aug 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/python/WMCore/WorkerThreads/BaseWorkerThread.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@ def __call__(self, parameters):
# force entire component to terminate
try:
self.component.prepareToStop()
except Exception as ex:
logging.error("Failed to halt component after worker crash: %s", str(ex))
except Exception as ex1:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it wasn't me, you have to thank pylint for that! ahaha

logging.error("Failed to halt component after worker crash: %s", str(ex1))
raise ex
# Put the thread to sleep
self.sleepThread()
Expand Down
2 changes: 2 additions & 0 deletions test/python/WMComponent_t/DBS3Buffer_t/DBSUpload_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
DBSUpload test TestDBSUpload module and the harness

"""
from __future__ import division

import json
import os
import threading
Expand Down
2 changes: 2 additions & 0 deletions test/python/WMCore_t/BossAir_t/MockPlugin_t.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
from __future__ import division

import unittest
from WMCore.BossAir.Plugins.MockPlugin import MockPlugin
from WMCore.BossAir.Plugins.BasePlugin import BossAirPluginException
Expand Down
1 change: 1 addition & 0 deletions test/python/WMCore_t/Misc_t/WMAgent_t.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python

from __future__ import division

import os
import time
Expand Down
9 changes: 6 additions & 3 deletions test/python/WMCore_t/REST_t/Daemon_t.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# python-future
from __future__ import print_function
from builtins import range

# system modules
import cherrypy
from multiprocessing import Process
Expand Down Expand Up @@ -36,7 +39,7 @@ def status(self):
"""Get the daemon status. Returns dictionary of time stamps of the
the last hundred times this thread last did 'work'."""
with self._cv:
return dict((k, v) for k, v in self._status.iteritems())
return dict((k, v) for k, v in self._status.items())

def stop(self):
"""Tell the task thread to quit."""
Expand Down Expand Up @@ -89,7 +92,7 @@ class TaskAPI(RESTApi):
def __init__(self, app, config, mount):
RESTApi.__init__(self, app, config, mount)
print("AMR mounting RESTApi app: %s, config: %s, mount: %s" % (app, config, mount))
tasks = [Task() for _ in xrange(0, 10)]
tasks = [Task() for _ in range(0, 10)]
self._add({ "status": Status(app, self, config, mount, tasks) })
print("AMR done mounting the 'status' API")

Expand All @@ -112,7 +115,7 @@ def test(self):
print("AMR headers: %s" % h)
print(self.getPage("/test", headers=h))
print(self.getPage("/test/status", headers=h))
for _ in xrange(0, 10):
for _ in range(0, 10):
self.getPage("/test/status", headers=h)
print(self.bodyY)
time.sleep(.3)
Expand Down
2 changes: 2 additions & 0 deletions test/python/WMCore_t/WMBS_t/JobSplitting_t/FixedDelay_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
Fixed delay job splitting.
"""

from __future__ import division

import unittest
import os
import threading
Expand Down
2 changes: 1 addition & 1 deletion test/python/WMCore_t/WMBS_t/JobSplitting_t/RunBased_t.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Event based splitting test.
"""


from __future__ import division


import unittest
Expand Down