diff options
author | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-02-12 14:14:17 (GMT) |
---|---|---|
committer | Giampaolo Rodola' <g.rodola@gmail.com> | 2013-02-12 14:14:17 (GMT) |
commit | 0166a283f65b08ee2dddb1b075f86862b8c7e3e4 (patch) | |
tree | f319f122b4865fcba24d86fd4d48f3f923cfea8b /Lib/smtpd.py | |
parent | b071d4f3da8db02dc5b355590f1f909896592ec3 (diff) | |
download | cpython-0166a283f65b08ee2dddb1b075f86862b8c7e3e4.zip cpython-0166a283f65b08ee2dddb1b075f86862b8c7e3e4.tar.gz cpython-0166a283f65b08ee2dddb1b075f86862b8c7e3e4.tar.bz2 |
modernize some modules' code by replacing OSError->ENOENT/ENOTDIR/EPERM/EEXIST occurrences with the corresponding pep-3151 exceptions (FileNotFoundError, NotADirectoryError, etc.)
Diffstat (limited to 'Lib/smtpd.py')
-rwxr-xr-x | Lib/smtpd.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/smtpd.py b/Lib/smtpd.py index 1e239a1..3cab264 100755 --- a/Lib/smtpd.py +++ b/Lib/smtpd.py @@ -850,8 +850,7 @@ if __name__ == '__main__': nobody = pwd.getpwnam('nobody')[2] try: os.setuid(nobody) - except OSError as e: - if e.errno != errno.EPERM: raise + except PermissionError: print('Cannot setuid "nobody"; try running with -n option.', file=sys.stderr) sys.exit(1) try: |