Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Ashley Sommer <ashleysommer@gmail.com>
  • Loading branch information
urbanmatthias and ashleysommer committed Oct 1, 2020
1 parent 81d0f99 commit 1fd1fb5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,11 @@ def serialize(
stream = os.fdopen(fd, "wb")
serializer.serialize(stream, base=base, encoding=encoding, **args)
stream.close()
dest = path if scheme == "file" else location
if hasattr(shutil, "move"):
shutil.move(name, location)
shutil.move(name, dest)
else:
shutil.copy(name, location)
shutil.copy(name, dest)
os.remove(name)

def parse(
Expand Down

0 comments on commit 1fd1fb5

Please sign in to comment.