From 2fa62f71e11c4276c36882349a8c28906ee535f3 Mon Sep 17 00:00:00 2001 From: JonnyWong16 Date: Tue, 24 Mar 2020 21:57:52 -0700 Subject: [PATCH] Replace file() with open() --- plexpy/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plexpy/__init__.py b/plexpy/__init__.py index 3538a8bf..c3634e5e 100644 --- a/plexpy/__init__.py +++ b/plexpy/__init__.py @@ -368,7 +368,7 @@ def daemonize(): except OSError as e: raise RuntimeError("2nd fork failed: %s [%d]", e.strerror, e.errno) - dev_null = file('/dev/null', 'r') + dev_null = open('/dev/null', 'r') os.dup2(dev_null.fileno(), sys.stdin.fileno()) si = open('/dev/null', "r") @@ -384,7 +384,7 @@ def daemonize(): if CREATEPID: logger.info("Writing PID %d to %s", pid, PIDFILE) - with file(PIDFILE, 'w') as fp: + with open(PIDFILE, 'w') as fp: fp.write("%s\n" % pid)