summaryrefslogtreecommitdiffstats
path: root/Obok_plugin
diff options
context:
space:
mode:
authorHdV <flx@desktop-windows>2020-09-30 13:25:32 +0100
committerHdV <flx@desktop-windows>2020-09-30 16:47:27 +0200
commit7f758566d36f2cc09882a7978f35c4792a00f325 (patch)
tree9345d957a4e1664d303c7a52dab7aade57242136 /Obok_plugin
parent21d4811bfe7241648afca187c33ab6204c8d81f3 (diff)
Changes to make obok work on win
_winreg renamed to winreg in python 3 os.popen3() replaced by subprocess.Popen()
Diffstat (limited to 'Obok_plugin')
-rw-r--r--Obok_plugin/obok/obok.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Obok_plugin/obok/obok.py b/Obok_plugin/obok/obok.py
index d20f6dc..ac0689b 100644
--- a/Obok_plugin/obok/obok.py
+++ b/Obok_plugin/obok/obok.py
@@ -353,7 +353,7 @@ class KoboLibrary(object):
if (self.kobodir == u""):
if sys.platform.startswith('win'):
- import _winreg as winreg
+ import winreg
if sys.getwindowsversion().major > 5:
if 'LOCALAPPDATA' in os.environ.keys():
# Python 2.x does not return unicode env. Use Python 3.x
@@ -444,8 +444,8 @@ class KoboLibrary(object):
macaddrs = []
if sys.platform.startswith('win'):
c = re.compile('\s(' + '[0-9a-f]{2}-' * 5 + '[0-9a-f]{2})(\s|$)', re.IGNORECASE)
- (p_in, p_out, p_err) = os.popen3('ipconfig /all')
- for line in p_out:
+ output = subprocess.Popen('ipconfig /all', shell=True, stdout=subprocess.PIPE, text=True).stdout
+ for line in output:
m = c.search(line)
if m:
macaddrs.append(re.sub("-", ":", m.group(1)).upper())