Remove unnecessary .absolute_path thanks to fspath.

This commit is contained in:
voussoir 2021-12-07 12:45:32 -08:00
parent 6867d32798
commit b2abb29626
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -17,10 +17,9 @@ def upgrade_1_to_2(db):
cur = db.sql.cursor()
redmash_dir = db.index_dir.parent.with_child('redmash')
if redmash_dir.exists:
if not redmash_dir.is_dir:
raise Exception(f'{redmash_dir.absolute_path} is not a directory!')
redmash_dir.assert_is_directory()
print('Renaming redmash folder to index.')
os.rename(redmash_dir.absolute_path, db.index_dir.absolute_path)
os.rename(redmash_dir, db.index_dir)
def upgrade_all(database_filename):
'''