[tor-commits] [ooni-probe/master] Use errno instead of integer to detect if file already exists
art at torproject.org
art at torproject.org
Mon Sep 19 12:14:24 UTC 2016
commit 1952ca0f1d55d8b78a1bed22c150bdfaf288b94e
Author: Arturo Filastò <arturo at filasto.net>
Date: Thu Sep 1 17:30:45 2016 +0200
Use errno instead of integer to detect if file already exists
---
ooni/settings.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/ooni/settings.py b/ooni/settings.py
index 065252b..a0ef0a5 100644
--- a/ooni/settings.py
+++ b/ooni/settings.py
@@ -1,6 +1,7 @@
import os
import sys
import yaml
+import errno
import getpass
from ConfigParser import SafeConfigParser
@@ -332,7 +333,7 @@ class OConfig(object):
try:
os.makedirs(path)
except OSError as exc:
- if exc.errno != 17:
+ if exc.errno != errno.EEXIST:
raise
def create_config_file(self, include_ip=False, include_asn=True,
More information about the tor-commits
mailing list