Skip to content

Commit 9cd6793

Browse files
committed
Working around a Jython 2.2.1 bug in posixpath.isfile()
1 parent e1eb3c4 commit 9cd6793

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: core/src/main/python/wlsdeploy/util/path_helper.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,12 @@ def get_local_filename_from_path(self, path):
410410
self._logger.entering(path, class_name=self._class_name, method_name=_method_name)
411411

412412
file_name = None
413+
414+
# posixpath.isfile() seems to not work in Jython 2.2.1 even though os.path.isfile() does...
413415
if not string_utils.is_empty(path) and \
414-
(not self._local_path_module.exists(path) or self._local_path_module.isfile(path)):
416+
(not self._local_path_module.exists(path) or os.path.isfile(path)):
415417
__, file_name = self._local_path_module.split(path)
418+
self._logger.fine('file_name returned %s' % file_name, class_name=self._class_name, method_name=_method_name)
416419
if string_utils.is_empty(file_name):
417420
file_name = None
418421

@@ -444,8 +447,9 @@ def get_local_pathname_from_path(self, path):
444447
self._logger.entering(path, class_name=self._class_name, method_name=_method_name)
445448

446449
file_path = None
450+
# posixpath.isfile() seems to not work in Jython 2.2.1 even though os.path.isfile() does...
447451
if not string_utils.is_empty(path) and \
448-
(not self._local_path_module.exists(path) or self._local_path_module.isfile(path)):
452+
(not self._local_path_module.exists(path) or os.path.isfile(path)):
449453
file_path, __ = self._local_path_module.split(path)
450454
if string_utils.is_empty(file_path):
451455
file_path = None

0 commit comments

Comments
 (0)