diff options
author | Youness Alaoui <kakaroto@kakaroto.homelinux.net> | 2015-10-21 21:26:33 +0300 |
---|---|---|
committer | Youness Alaoui <kakaroto@kakaroto.homelinux.net> | 2015-10-21 21:55:39 +0300 |
commit | abd004245f8a5974693a00423cda817d5622ab89 (patch) | |
tree | 16aa090701a4d659c52a0350b731de6ac032bcc2 /Cura | |
parent | 54d5ce179fb53564f95807e35a97bdea11d8c4ca (diff) |
Do not execute a statement without catching the return value in global namespace
The issue is that any statement without a variable to catch the
returned value will cause that value to be stored in the _ variable
and when that happens in the global namespace, it will cause issues
such as the gettext _ variable being overwritten
Diffstat (limited to 'Cura')
-rw-r--r-- | Cura/gui/printWindow.py | 4 | ||||
-rw-r--r-- | Cura/gui/util/openglHelpers.py | 3 | ||||
-rw-r--r-- | Cura/gui/util/taskbar.py | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index fe5f48930e..b21b79e149 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -37,8 +37,8 @@ elif sys.platform.startswith('darwin'): frameworkIdentifier="com.apple.iokit", frameworkPath=objc.pathForFramework("/System/Library/Frameworks/IOKit.framework"), globals=globals()) - objc.loadBundleFunctions(bundle, globals(), [("IOPMAssertionCreateWithName", b"i@I@o^I")]) - objc.loadBundleFunctions(bundle, globals(), [("IOPMAssertionRelease", b"iI")]) + foo = objc.loadBundleFunctions(bundle, globals(), [("IOPMAssertionCreateWithName", b"i@I@o^I")]) + foo = objc.loadBundleFunctions(bundle, globals(), [("IOPMAssertionRelease", b"iI")]) def preventComputerFromSleeping(frame, prevent): if prevent: success, preventComputerFromSleeping.assertionID = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoDisplaySleep, kIOPMAssertionLevelOn, "Cura is printing", None) diff --git a/Cura/gui/util/openglHelpers.py b/Cura/gui/util/openglHelpers.py index 0c1e9cb6ce..3880c3644f 100644 --- a/Cura/gui/util/openglHelpers.py +++ b/Cura/gui/util/openglHelpers.py @@ -14,7 +14,8 @@ from OpenGL.GLUT import * from OpenGL.GLU import * from OpenGL.GL import * from OpenGL.GL import shaders -glutInit() #Hack; required before glut can be called. Not required for all OS. + +foo = glutInit() #Hack; required before glut can be called. Not required for all OS. class GLReferenceCounter(object): def __init__(self): diff --git a/Cura/gui/util/taskbar.py b/Cura/gui/util/taskbar.py index e78fc0f229..a59f73dd87 100644 --- a/Cura/gui/util/taskbar.py +++ b/Cura/gui/util/taskbar.py @@ -5,11 +5,11 @@ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AG try: import comtypes.client as cc - cc.GetModule('taskbarlib.tlb') + foo = cc.GetModule('taskbarlib.tlb') import comtypes.gen.TaskbarLib as tbl ITaskbarList3 = cc.CreateObject("{56FDF344-FD6D-11d0-958A-006097C9A090}", interface=tbl.ITaskbarList3) - ITaskbarList3.HrInit() + foo = ITaskbarList3.HrInit() #Stops displaying progress and returns the button to its normal state. Call this method with this flag to dismiss the progress bar when the operation is complete or canceled. TBPF_NOPROGRESS = 0x00000000 |