From acdb48d6e244454084de229e18eb98b92bcf6c77 Mon Sep 17 00:00:00 2001 From: xinglijun Date: Sun, 31 May 2020 11:46:02 +0800 Subject: [PATCH] Update relative import to be python 3 compatible In reveal.py and dsdt.py, use "from . import" to do relative import from the current directory. Otherwise it could incurr "module 'run' has no attribute 'Run'" error for python 3. --- Scripts/dsdt.py | 2 +- Scripts/reveal.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Scripts/dsdt.py b/Scripts/dsdt.py index 2aecb8e..d38bb2e 100644 --- a/Scripts/dsdt.py +++ b/Scripts/dsdt.py @@ -2,7 +2,7 @@ # 0.0.0 import os, tempfile, shutil, plistlib, sys, binascii, zipfile, getpass sys.path.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__)))) -import run, downloader, utils +from . import run, downloader, utils class DSDT: def __init__(self, **kwargs): diff --git a/Scripts/reveal.py b/Scripts/reveal.py index f12acb7..d1aec03 100644 --- a/Scripts/reveal.py +++ b/Scripts/reveal.py @@ -1,6 +1,6 @@ import sys, os sys.path.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__)))) -import run +from . import run class Reveal: