- lim = resource.getrlimit(resource_type)
- lim = adjust_lim((hard, soft, min), lim)
- resource.setrlimit(resource_type, lim)
+ if hasattr(resource, 'RLIMIT_' + type):
+ lim = resource.getrlimit(resource_type)
+ lim = adjust_lim((hard, soft, min), lim)
+ resource.setrlimit(resource_type, lim)