Commit f82c9a94 by Őry Máté

fix bugs in fix

parent a38e1fe0
...@@ -98,7 +98,7 @@ def notify(url): ...@@ -98,7 +98,7 @@ def notify(url):
os.environ["DISPLAY"] = olddisplay os.environ["DISPLAY"] = olddisplay
def file_already_exists(name): def file_already_exists(name, mode=0644):
"""Return whether file already exists, create it if not. """Return whether file already exists, create it if not.
Other errors are silently ignored as the file will be reopened anyways. Other errors are silently ignored as the file will be reopened anyways.
...@@ -106,12 +106,12 @@ def file_already_exists(name): ...@@ -106,12 +106,12 @@ def file_already_exists(name):
""" """
try: try:
fd = os_open(name, O_CREAT | O_EXCL) fd = os.open(name, os.O_CREAT | os.O_EXCL, mode)
except OSError as e: except OSError as e:
if e.errno == EEXIST: if e.errno == os.EEXIST:
return True return True
else: else:
close(fd) os.close(fd)
return False return False
...@@ -139,7 +139,6 @@ def search_display(): ...@@ -139,7 +139,6 @@ def search_display():
def main(): def main():
args = parse_arguments() args = parse_arguments()
notify(args.url) notify(args.url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment