Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(dmg-builder): the "import" unbound issue #6672

Merged
merged 1 commit into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/cold-crabs-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"dmg-builder": patch
---

fix(dmg-builder): the "import" unbound issue
17 changes: 10 additions & 7 deletions packages/dmg-builder/vendor/dmgbuild/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__), "..")))

Expand Down Expand Up @@ -284,4 +287,4 @@ def build_dmg():
except:
raise

build_dmg()
build_dmg()