diff --git a/.gitignore b/.gitignore index f26b8e6..e2f2aaa 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .idea/ +__pycache__/ test/ diff --git a/simple_backup/simple_backup.py b/simple_backup/simple_backup.py index b349f19..efcc66c 100755 --- a/simple_backup/simple_backup.py +++ b/simple_backup/simple_backup.py @@ -185,9 +185,10 @@ class Backup: fp.write('\n') with open(self._exclude_path, 'w') as fp: - for e in self.exclude: - fp.write(e) - fp.write('\n') + if self.exclude is not None: + for e in self.exclude: + fp.write(e) + fp.write('\n') if self.keep != -1 and self.remove_before: self.remove_old_backups()