aboutsummaryrefslogtreecommitdiff
path: root/Python/pywarpx/callbacks.py
diff options
context:
space:
mode:
authorGravatar kzhu-ME <86268612+kzhu-ME@users.noreply.github.com> 2021-06-24 00:43:41 -0700
committerGravatar GitHub <noreply@github.com> 2021-06-24 00:43:41 -0700
commit78ebf77e84f458eb6eb8917f333196acaa84e1c0 (patch)
tree0c5a4aa3170b4c21b092000eb8dba96cc126f33b /Python/pywarpx/callbacks.py
parenta5ff5a4385a756304414dc8f5293e9341c905d52 (diff)
downloadWarpX-78ebf77e84f458eb6eb8917f333196acaa84e1c0.tar.gz
WarpX-78ebf77e84f458eb6eb8917f333196acaa84e1c0.tar.zst
WarpX-78ebf77e84f458eb6eb8917f333196acaa84e1c0.zip
Refactored basestring to str (#2030)
Diffstat (limited to '')
-rw-r--r--Python/pywarpx/callbacks.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/Python/pywarpx/callbacks.py b/Python/pywarpx/callbacks.py
index d0b1688a9..4ccaa479d 100644
--- a/Python/pywarpx/callbacks.py
+++ b/Python/pywarpx/callbacks.py
@@ -117,7 +117,7 @@ class CallbackFunctions(object):
self.funcs.remove(f)
continue
result = getattr(object,f[1])
- elif isinstance(f,basestring):
+ elif isinstance(f,str):
import __main__
if f in __main__.__dict__:
result = __main__.__dict__[f]
@@ -137,7 +137,7 @@ class CallbackFunctions(object):
print("by something not callable. This can happen during restart")
print("if a function name had later been used as a variable name.")
print(self.name)
- if isinstance(f,basestring):
+ if isinstance(f,str):
print("The name of the call back is %s"%f)
print("\n\n")
continue
@@ -180,12 +180,12 @@ class CallbackFunctions(object):
if f.im_self is object and f.__name__ == func[1]:
self.funcs.remove(func)
return
- elif isinstance(func,basestring):
+ elif isinstance(func,str):
if f.__name__ == func:
self.funcs.remove(func)
return
- elif isinstance(f,basestring):
- if isinstance(func,basestring): funcname = func
+ elif isinstance(f,str):
+ if isinstance(func,str): funcname = func
elif isinstance(func,list): funcname = None
else: funcname = func.__name__
if f == funcname:
@@ -204,7 +204,7 @@ class CallbackFunctions(object):
object = self._getmethodobject(func)
if f.im_self is object and f.__name__ == func[1]:
return 1
- elif isinstance(func,basestring):
+ elif isinstance(func,str):
if f.__name__ == func:
return 1
return 0