use a context-manager

just to be sure...
Merge branch 'release/3.4.0.1' into develop
Merge pull request #19 from hiaselhans/patch-1

use a context-manager
Released version 3.4.0.2
Merge branch 'release/3.4.0.2'