public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ashley E Desimone" <ashley.e.desimone@intel.com>
To: devel@edk2.groups.io
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>,
	Puja Pandya <puja.pandya@intel.com>,
	Bret Barkelew <Bret.Barkelew@microsoft.com>,
	Prince Agyeman <prince.agyeman@intel.com>,
	Erik Bjorge <erik.c.bjorge@intel.com>
Subject: [edk2-staging/EdkRepo] [PATCH] EdkRepo: Replace imp.reload with importlib.reload
Date: Wed, 11 Nov 2020 15:41:36 -0800	[thread overview]
Message-ID: <20201111234136.1825-1-ashley.e.desimone@intel.com> (raw)

The imp module is deprecated since Python 3.4 in favor
of importlib. This patch replaces uses of imp.reload()
with importlib.reload() and removes unused imp imports.

Cc: Ashley E Desimone <ashley.e.desimone@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Puja Pandya <puja.pandya@intel.com>
Cc: Bret Barkelew <Bret.Barkelew@microsoft.com>
Cc: Prince Agyeman <prince.agyeman@intel.com>
Cc: Erik Bjorge <erik.c.bjorge@intel.com>
Signed-off-by: Ashley E Desimone <ashley.e.desimone@intel.com>
---
 edkrepo/__main__.py            | 4 ++--
 edkrepo/edkrepo_cli.py         | 1 -
 edkrepo/edkrepo_entry_point.py | 4 ++--
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/edkrepo/__main__.py b/edkrepo/__main__.py
index 115a779..2d538d3 100644
--- a/edkrepo/__main__.py
+++ b/edkrepo/__main__.py
@@ -7,7 +7,7 @@
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
 
-import imp
+import importlib
 import os
 import sys
 import site
@@ -23,7 +23,7 @@ for directory in sitepackages:
         edkrepo_site_dir = edkrepo_package_path
         break
 else:
-    imp.reload(edkrepo)
+    importlib.reload(edkrepo)
 import edkrepo.edkrepo_entry_point
 
 if __name__ == '__main__':
diff --git a/edkrepo/edkrepo_cli.py b/edkrepo/edkrepo_cli.py
index 4e7ff16..1adb63f 100644
--- a/edkrepo/edkrepo_cli.py
+++ b/edkrepo/edkrepo_cli.py
@@ -18,7 +18,6 @@ import os
 import subprocess
 import site
 import inspect
-import imp
 import importlib.util
 import datetime as dt
 
diff --git a/edkrepo/edkrepo_entry_point.py b/edkrepo/edkrepo_entry_point.py
index dd2b36e..30d65ff 100644
--- a/edkrepo/edkrepo_entry_point.py
+++ b/edkrepo/edkrepo_entry_point.py
@@ -8,7 +8,7 @@
 #
 
 import argparse
-import imp
+import importlib
 import importlib.util
 import inspect
 import json
@@ -37,7 +37,7 @@ for directory in sitepackages:
         edkrepo_site_dir = edkrepo_package_path
         break
 else:
-    imp.reload(edkrepo)
+    importlib.reload(edkrepo)
     edkrepo_package_path = os.path.dirname(os.path.dirname(edkrepo.__file__))
     for directory in sitepackages:
         if edkrepo_package_path == directory:
-- 
2.27.0.windows.1


             reply	other threads:[~2020-11-11 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11 23:41 Ashley E Desimone [this message]
2020-11-15  3:00 ` [edk2-staging/EdkRepo] [PATCH] EdkRepo: Replace imp.reload with importlib.reload Nate DeSimone
2020-11-15  3:03 ` Nate DeSimone

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201111234136.1825-1-ashley.e.desimone@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox