Skip to content

Commit 076d875

Browse files
committed
Wrap UnsupportedPosixFeatureException in pwd builtins
1 parent e63699f commit 076d875

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/PwdModuleBuiltins.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
import com.oracle.graal.python.runtime.PosixSupportLibrary;
7575
import com.oracle.graal.python.runtime.PosixSupportLibrary.PosixException;
7676
import com.oracle.graal.python.runtime.PosixSupportLibrary.PwdResult;
77+
import com.oracle.graal.python.runtime.PosixSupportLibrary.UnsupportedPosixFeatureException;
7778
import com.oracle.graal.python.runtime.PythonContext;
7879
import com.oracle.graal.python.runtime.exception.PException;
7980
import com.oracle.graal.python.runtime.object.PFactory;
@@ -166,6 +167,8 @@ static Object doGetpwuid(VirtualFrame frame, Object uidObj,
166167
}
167168
} catch (PosixException e) {
168169
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorFromPosixException(frame, e);
170+
} catch (UnsupportedPosixFeatureException e) {
171+
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorUnsupported(frame, e);
169172
}
170173
if (pwd == null) {
171174
throw raiseUidNotFound(inliningTarget, raiseNode);
@@ -213,6 +216,8 @@ static Object doGetpwname(VirtualFrame frame, TruffleString name,
213216
}
214217
} catch (PosixException e) {
215218
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorFromPosixException(frame, e);
219+
} catch (UnsupportedPosixFeatureException e) {
220+
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorUnsupported(frame, e);
216221
}
217222
if (pwd == null) {
218223
throw raiseNode.raise(inliningTarget, PythonBuiltinClassType.KeyError, ErrorMessages.GETPWNAM_NAME_NOT_FOUND, name);
@@ -237,6 +242,8 @@ static Object doGetpall(VirtualFrame frame,
237242
entries = posixLib.getpwentries(context.getPosixSupport());
238243
} catch (PosixException e) {
239244
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorFromPosixException(frame, e);
245+
} catch (UnsupportedPosixFeatureException e) {
246+
throw constructAndRaiseNode.get(inliningTarget).raiseOSErrorUnsupported(frame, e);
240247
}
241248
PythonLanguage language = context.getLanguage(inliningTarget);
242249
Object[] result = new Object[entries.length];

0 commit comments

Comments
 (0)