diff --git a/.changeset/cold-crabs-destroy.md b/.changeset/cold-crabs-destroy.md new file mode 100644 index 00000000000..5a5fa4a6585 --- /dev/null +++ b/.changeset/cold-crabs-destroy.md @@ -0,0 +1,5 @@ +--- +"dmg-builder": patch +--- + +fix(dmg-builder): the "import" unbound issue diff --git a/packages/dmg-builder/vendor/dmgbuild/core.py b/packages/dmg-builder/vendor/dmgbuild/core.py index 8154acbffbf..1adc35289fc 100644 --- a/packages/dmg-builder/vendor/dmgbuild/core.py +++ b/packages/dmg-builder/vendor/dmgbuild/core.py @@ -4,13 +4,16 @@ import os import re import sys + if sys.version_info.major == 3: - try: - from importlib import reload - except ImportError: - from imp import reload -reload(sys) # Reload is a hack -sys.setdefaultencoding('UTF8') + try: + from importlib import reload + except ImportError: + from imp import reload + reload(sys) # To workaround the unbound issue +else: + reload(sys) # Reload is a hack + sys.setdefaultencoding('UTF8') sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), ".."))) @@ -284,4 +287,4 @@ def build_dmg(): except: raise -build_dmg() \ No newline at end of file +build_dmg()