-
Notifications
You must be signed in to change notification settings - Fork 86
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 DIP Parts to run with FreeCAD 0.18 and Python 3 #372
base: master
Are you sure you want to change the base?
Conversation
@acisternino |
@easyw The integer division fixes probably are but the use of Feel free to close this if you don't want to wait. |
@acisternino |
The only alternative that works in python2 and python3 is imp.reload. However "imp" package is deprecated in Python3... Shouldn't this repository move away from supporting python 2 anyway? See #315 I ask because I'm working on similar fixes for BGA packages and others that do not work with FC 0.18. |
a solution is already adopted here: kicad-3d-models-in-freecad/cadquery/FCAD_script_generator/CP_Tantalum_SMD/main_generator.py Lines 141 to 146 in e935e68
|
Another solution could be using something like this: try:
reload # Python 2.7
except NameError:
from importlib import reload # Python 3.4+ I'll try to find solutions for the other features. |
It would be good if we can agree the "best method" to do this. I am already in process of fixing all modules (see my PR #374) and what I have done is define the below function in cq_cad_tools.py
Then at the top of all files that use import, I added below 3 lines of code: I'd rather agree this before I go too far with my changes on my PR #374 ... |
@Qbort this approach seems fine.. adding the code in a common module is requiring to check and fix all the generators... is what you are you going to do? If so I'm fine with this approach 😄 |
@acisternino in general I try to use [try excet] as little as possible inside the code... I would prefer to keep the first solution suggested |
Fixes issue running the DIP Parts scripts with FreeCAD 0.18 and Python 3.
Mostly float division and import issues.