Skip to content

Commit

Permalink
Fix pythonpath update for relative file paths (#158)
Browse files Browse the repository at this point in the history
* Fix pythonpath update for relative file paths

* Add script path at the beginning

* Add typing_extensions to CI reqs
  • Loading branch information
adam-urbanczyk authored Jun 29, 2020
1 parent f6fafbe commit b1cdadd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cq_editor/widgets/debugger.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ def compile_code(self,cq_script):
def _exec(self, code, locals_dict, globals_dict):

with ExitStack() as stack:
p = Path(self.parent().components['editor'].filename).dirname()
p = Path(self.parent().components['editor'].filename).abspath().dirname()
if self.preferences['Add script dir to path'] and p:
sys.path.append(p)
sys.path.insert(0,p)
stack.callback(sys.path.remove, p)
if self.preferences['Change working dir to script dir'] and p:
stack.enter_context(p)
Expand Down
1 change: 1 addition & 0 deletions cqgui_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ dependencies:
- requests
- nomkl
- ezdxf
- typing_extensions
- pip
- pip:
- "https://github.com/CadQuery/cadquery/archive/master.zip"

0 comments on commit b1cdadd

Please sign in to comment.