From da09f7c3d93c9feaf880ca739b506f09a5bdc290 Mon Sep 17 00:00:00 2001 From: PoroCYon Date: Wed, 14 Nov 2018 00:07:58 +0100 Subject: [PATCH] OpenSCAD: fix error in workaroundforissue128needed with date formats (YYYYMMDD vs YYYY.MM.DD) This happens when the git version of OpenSCAD is installed (which uses YYYYMMDD), instead of the latest released version (from 2015, which uses YYYY.MM.DD). --- src/Mod/OpenSCAD/OpenSCADUtils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Mod/OpenSCAD/OpenSCADUtils.py b/src/Mod/OpenSCAD/OpenSCADUtils.py index 4fbac7d018..5c11e6060f 100644 --- a/src/Mod/OpenSCAD/OpenSCADUtils.py +++ b/src/Mod/OpenSCAD/OpenSCADUtils.py @@ -100,7 +100,11 @@ def workaroundforissue128needed(): see https://github.com/openscad/openscad/issues/128''' vdate=getopenscadversion().split('-')[0] vdate=vdate.split(' ')[2].split('.') - year,mon=int(vdate[0]),int(vdate[1]) + if len(vdate) == 1: # probably YYYYMMDD format (i.e. git version) + vdate = vdate[0] + year, mon = int("".join(vdate[0:4])), int("".join(vdate[4:6])) + else: # YYYY.MM(.DD?) (latest release) + year,mon=int(vdate[0]),int(vdate[1]) return (year<2012 or (year==2012 and (mon <6 or (mon == 6 and \ (len(vdate)<3 or int(vdate[2]) <=23))))) #ifdate=int(vdate[0])+(int(vdate[1])-1)/12.0