Skip to content

Commit

Permalink
Use of a variable only when required.
Browse files Browse the repository at this point in the history
Also - fixed an issue related using 'append' instead of 'push' on a list

Signed-off-by: Ashesh Vashi <ashesh.vashi@enterprisedb.com>
  • Loading branch information
asheshv committed May 25, 2021
1 parent 9a7a75f commit 39cc8a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions gssapi/_win_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,12 @@
)
#: Download location for KfW
KFW_DL = "https://web.mit.edu/KERBEROS/dist"
is64bits = sys.maxsize > 2**32


def kfw_available():
"""Return if the main GSSAPI DLL for KfW can be loaded"""
try: # to load the main GSSAPI DLL
if is64bits is True:
if sys.maxsize > 2**32:
ctypes.WinDLL('gssapi64.dll')
else:
ctypes.WinDLL('gssapi32.dll')
Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def get_output(*args, **kwargs):
link_args = ['-framework', 'GSS']
elif winkrb_path:
_libs = os.path.join(
winkrb_path, 'lib', 'amd64' if sys.maxsize > 2 ** 32 else 'i386'
winkrb_path, 'lib', 'amd64' if is64bits else 'i386'
)
link_args = (
['-L%s' % _libs]
Expand All @@ -124,7 +124,7 @@ def get_output(*args, **kwargs):
'-I%s' % os.path.join(winkrb_path, 'include'),
]
if is64bits:
compile_args.push('-DMS_WIN64')
compile_args.append('-DMS_WIN64')
elif os.environ.get('MINGW_PREFIX'):
compile_args = ['-fPIC']
else:
Expand Down Expand Up @@ -185,7 +185,7 @@ def get_output(*args, **kwargs):
# Plain msys, not running in MINGW_PREFIX. Try to get the lib from one
_main_lib = (
'/mingw%d/bin/libgss-3.dll'
% (64 if sys.maxsize > 2 ** 32 else 32)
% (64 if is64bits else 32)
)
if os.path.exists(_main_lib):
main_lib = _main_lib
Expand Down

0 comments on commit 39cc8a6

Please sign in to comment.