~longsleep/snapcraft/snapcraft-debs-plugin

« back to all changes in this revision

Viewing changes to snapcraft/cmds.py

  • Committer: Snappy Tarmac
  • Author(s): Leo Arias
  • Date: 2015-09-18 17:33:10 UTC
  • mfrom: (180.1.3 fix1497371-clean_clean)
  • Revision ID: snappy_tarmac-20150918173310-24xhn0pqwis3hawo
On clean, check the contents of the parts dir only if it exists. by elopio approved by sergiusens

Show diffs side-by-side

added added

removed removed

Lines of Context:
237
237
            shutil.rmtree(part.partdir)
238
238
 
239
239
    # parts dir does not contain only generated code.
240
 
    if not os.listdir(common.get_partsdir()):
 
240
    if (os.path.exists(common.get_partsdir()) and
 
241
            not os.listdir(common.get_partsdir())):
241
242
        os.rmdir(common.get_partsdir())
242
243
 
243
244
    logger.info('Cleaning up staging area')