Skip to content

Commit 39cc8a6

Browse files
committed
Use of a variable only when required.
Also - fixed an issue related using 'append' instead of 'push' on a list Signed-off-by: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
1 parent 9a7a75f commit 39cc8a6

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

Diff for: gssapi/_win_config.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
)
1919
#: Download location for KfW
2020
KFW_DL = "https://web.mit.edu/KERBEROS/dist"
21-
is64bits = sys.maxsize > 2**32
2221

2322

2423
def kfw_available():
2524
"""Return if the main GSSAPI DLL for KfW can be loaded"""
2625
try: # to load the main GSSAPI DLL
27-
if is64bits is True:
26+
if sys.maxsize > 2**32:
2827
ctypes.WinDLL('gssapi64.dll')
2928
else:
3029
ctypes.WinDLL('gssapi32.dll')

Diff for: setup.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def get_output(*args, **kwargs):
105105
link_args = ['-framework', 'GSS']
106106
elif winkrb_path:
107107
_libs = os.path.join(
108-
winkrb_path, 'lib', 'amd64' if sys.maxsize > 2 ** 32 else 'i386'
108+
winkrb_path, 'lib', 'amd64' if is64bits else 'i386'
109109
)
110110
link_args = (
111111
['-L%s' % _libs]
@@ -124,7 +124,7 @@ def get_output(*args, **kwargs):
124124
'-I%s' % os.path.join(winkrb_path, 'include'),
125125
]
126126
if is64bits:
127-
compile_args.push('-DMS_WIN64')
127+
compile_args.append('-DMS_WIN64')
128128
elif os.environ.get('MINGW_PREFIX'):
129129
compile_args = ['-fPIC']
130130
else:
@@ -185,7 +185,7 @@ def get_output(*args, **kwargs):
185185
# Plain msys, not running in MINGW_PREFIX. Try to get the lib from one
186186
_main_lib = (
187187
'/mingw%d/bin/libgss-3.dll'
188-
% (64 if sys.maxsize > 2 ** 32 else 32)
188+
% (64 if is64bits else 32)
189189
)
190190
if os.path.exists(_main_lib):
191191
main_lib = _main_lib

0 commit comments

Comments
 (0)