Skip to content

Commit

Permalink
Fix potential bugs detected by QuantifiedCode.com.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasily-v-ryabov committed Aug 3, 2015
1 parent 6df1407 commit f8f3f3e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pywinauto/controlproperties.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,10 @@ def GetMenuBlocks(ctrls):


#====================================================================
def MenuBlockAsControls(menuItems, parentage = []):
def MenuBlockAsControls(menuItems, parentage = None):

if parentage is None:
parentage = []
blocks = []

curBlock = []
Expand Down
1 change: 0 additions & 1 deletion pywinauto/tests/truncation.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ def _WindowTruncInfo(win):
"CheckBox" : _CheckBoxTruncInfo,
"GroupBox" : _GroupBoxTruncInfo,
"RadioButton" : _RadioButtonTruncInfo,
"Button" : _ButtonTruncInfo,
"Edit": _EditTruncInfo,
"Static" : _StaticTruncInfo,

Expand Down
6 changes: 2 additions & 4 deletions pywinauto/win32functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@
# 59 Temple Place,
# Suite 330,
# Boston, MA 02111-1307 USA
"Defines Windows(tm) functions"
"""Defines Windows(tm) functions"""
from __future__ import absolute_import

__revision__ = "$Revision$"

import ctypes
from ctypes import *
from ctypes import c_uint, c_short

import sys
if sys.platform == "cygwin":
Expand Down
2 changes: 1 addition & 1 deletion sandbox/controlactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ def add_actions(to_obj):
to_obj.__class__, action_name, _standard_action_funcs[action_name])

# check if there are actions specific to this type of control
if _class_specific_actions.has_key(to_obj.FriendlyClassName):
if to_obj.FriendlyClassName in _class_specific_actions.keys():

# apply these actions to the class
actions = _class_specific_actions[to_obj.FriendlyClassName]
Expand Down

0 comments on commit f8f3f3e

Please sign in to comment.